GNOME Bugzilla – Bug 748700
avimux: stopping file without index fails
Last modified: 2016-05-13 08:59:16 UTC
Created attachment 302641 [details] [review] avimux: Check for NULL index before writing it Sending eos to avimux with a video sink pad that has not received any buffers causes a critical: GStreamer-CRITICAL **: gst_memory_new_wrapped: assertion 'data != NULL' failed The problem is that the muxer tries to write the index, even though it is not available.
+ Trace 235017
I have a test case, where I create the pipeline: videotestsrc ! x264enc ! avimux ! fakesink I put a blocking probe on the src pad of x264enc, and drop the first buffer showing up. avimux never receives any buffers. On SIGINT I send an EOS event to the avimux sinkpad, which causes the assertion. I have attached a patch that checks for a valid index before writing the index from gst_avi_mux_stop_file. Maybe we want to skip rewriting the header altogether since we are dealing with an empty file anyway?
Created attachment 302642 [details] Test case
Created attachment 302648 [details] [review] avimux: Do not write index and header if idx is NULL Actually, there are some other bugs in the rewriting of the header if using audio, so it might indeed be best to skip the rewriting of the header. The other bug I found is a FPE because of: avipad->parent.hdr.rate = avipad->auds.av_bps / avipad->auds.blockalign;
+ Trace 235018
Easy way to reproduce: gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw,width=16,height=16 ! identity drop-probability=1.0 ! avimux ! fakesink
Pushed, thanks for the patch, and sorry it fell through the cracks! commit ce05adfb30cbb48da5f9d3226f4fb0172684fe26 Author: Jesper Larsen <knorr.jesper@gmail.com> Date: Thu Apr 30 14:43:04 2015 +0200 avimux: Do not write index and header if idx is NULL Fixes criticals with e.g. videotestsrc num-buffers=1 ! identity drop-probability=1.0 ! avimux ! fakesink https://bugzilla.gnome.org/show_bug.cgi?id=748700