After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687192 - dvdsubdec: allocates buffer 4 times the size needed
dvdsubdec: allocates buffer 4 times the size needed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
1.x
Other Linux
: Normal normal
: 1.0.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-30 12:54 UTC by Andreas Frisch
Modified: 2012-10-30 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dvdsubdec: allocate correct amount of memory for bitmap (854 bytes, patch)
2012-10-30 12:59 UTC, Andreas Frisch
committed Details | Review

Description Andreas Frisch 2012-10-30 12:54:32 UTC
i've noticed that the buffers that dvdsubdec generates were 6635520 bytes each. 

/GstPipeline:pipeline0/GstDvdSubDec:dvdsubdec0.GstPad:src: caps = video/x-raw, format=(string)ARGB, width=(int)720, height=(int)576, framerate=(fraction)0/1

that's 4 times the expected size of a PAL sized ARGB bitmap of 720*576*4 = 1658880

i suspect a bug which was introduced during porting to new api
the original allocation line was:
gst_pad_alloc_buffer_and_set_caps (dec->srcpad, 0, 4 * dec->in_width * dec->in_height, GST_PAD_CAPS (dec->srcpad), &out_buf);
while the new one uses:
out_buf = gst_buffer_new_allocate (NULL, 4 * GST_VIDEO_INFO_SIZE (&dec->info), &params);

with a macro which i don't know yet but it's obviously already considering the bit depth per pixel, so that the extra 4 * results in a buffer that's 128bpp instead of 32bpp.

propsed fix to be attached.
Comment 1 Andreas Frisch 2012-10-30 12:59:43 UTC
Created attachment 227634 [details] [review]
dvdsubdec: allocate correct amount of memory for bitmap
Comment 2 Jan Schmidt 2012-10-30 13:14:32 UTC
Review of attachment 227634 [details] [review]:

Seems sensible
Comment 3 Tim-Philipp Müller 2012-10-30 13:18:45 UTC
commit e5495e7f676c010b86d87a9a7397b9986b88a0bb
Author: Andreas Frisch <fraxinas@opendreambox.org>
Date:   Tue Oct 30 13:39:52 2012 +0100

    dvdsubdec: allocate correct amount of memory for bitmap
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687192