GNOME Bugzilla – Bug 346663
Segmentation error with fakesrc, fakesink and a filter
Last modified: 2006-07-18 10:42:33 UTC
Steps to reproduce: I get a segmentation error when I run the following command: gst-launch fakesrc ! 'video/x-raw-yuv,format=(fourcc)YUY2,width=176,height=144' ! ffmpegcolorspace ! fakesink It seems to be caused by gst_base_transform_prepare_output_buffer() being called with an in_buf with size 0 and out_size being 0, which causes a call to gst_buffer_create_sub() with size being 0, which in turn causes it to return NULL, which isn't handled... Stack trace:
+ Trace 69204
Other information: The trace above was attained on an embedded box running on the CRIS architecture and using uClibc. However, the same segmentation error occurs with ix86 and glibc.
yeah, that subbuffer size > 0 check is unneeded. working an fix and unit tests for various other 0 size related buffer stuff.
This should fix the assert. No guarantee that the next element will handle a 0 sized buffer. * gst/gstbuffer.c: (_gst_buffer_copy), (gst_buffer_create_sub): * tests/check/gst/gstbuffer.c: (GST_START_TEST), (gst_buffer_suite): No point in checking if the size of the subbuffer > 0, the code handles it correclty as demonstrated by unit test. Also add a unit test for the zero sized _new_and_alloc and _copy. Fixes #346663.