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 6dc767ffbb9baf3adf8e0c62eb4fbf67a9119561..e5aa4371625a6dea067408c1fa28a2968d497451 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) {