GNOME Bugzilla – Bug 330844
mpeg2dec crashes with "cropped" MPEG videos
Last modified: 2006-02-15 10:23:26 UTC
Please describe the problem: If the image in a MPEG video file needs to be cropped, mpeg2dec allocates a new buffer with the cropped image. But there are two serious problems with that - the newly allocated buffer has no caps - the newly allocated buffer is never freed, while the old buffer is double-freed, causing memory corruption and crashes Steps to reproduce: 1. Open an MPEG video file with video frames needing cropping in a GStreamer app, in a pipeline which has mpeg2dec in it and terminates with xvimagesink 2. xvimagesink will break, since it does not get "width" and "height" caps Actual results: Expected results: Does this happen every time? Other information:
Created attachment 59161 [details] [review] Patch to add caps to "cropped" frame, and to correctly free it instead of double-freeing the wrong one
thanks a lot for sending a patch
Looks good, raising priority so someone can commit this
* ext/amrnb/amrnbdec.c: (gst_amrnbdec_setcaps), (gst_amrnbdec_chain), (gst_amrnbdec_state_change): Some more comments. * ext/mpeg2dec/gstmpeg2dec.c: (crop_buffer), (handle_slice): Applied patch from Fabrizio Gennari, fixes #330844.