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
This commit is contained in:
Jesper Larsen 2015-04-30 14:43:04 +02:00 committed by Tim-Philipp Müller
parent f89c4f9f4b
commit ce05adfb30

View file

@ -1784,6 +1784,10 @@ gst_avi_mux_stop_file (GstAviMux * avimux)
GSList *node;
GstSegment segment;
/* Do not write index and header, if the index has no data */
if (avimux->idx == NULL)
return GST_FLOW_OK;
/* if bigfile, rewrite header, else write indexes */
/* don't bail out at once if error, still try to re-write header */
if (avimux->video_pads > 0) {