avimux: Do not write index and header if idx is NULL
authorJesper Larsen <knorr.jesper@gmail.com>
Thu, 30 Apr 2015 12:43:04 +0000 (14:43 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 13 May 2016 08:55:45 +0000 (09:55 +0100)
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

gst/avi/gstavimux.c

index 6dc767f..e5aa437 100644 (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) {