qtdemux: Fix taglist memory leak
authorVineeth TM <vineeth.tm@samsung.com>
Wed, 14 Oct 2015 00:29:50 +0000 (09:29 +0900)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 17 Oct 2015 08:03:13 +0000 (11:03 +0300)
Free the stream and its sub items instead of just the stream

https://bugzilla.gnome.org/show_bug.cgi?id=756544

gst/isomp4/qtdemux.c

index 1de62df..0425d94 100644 (file)
@@ -8547,7 +8547,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
           "found, assuming preview image or something; skipping track",
           stream->duration, stream->timescale, qtdemux->duration,
           qtdemux->timescale);
-      g_free (stream);
+      if (new_stream)
+        gst_qtdemux_stream_free (qtdemux, stream);
       return TRUE;
     }
   }
@@ -8625,7 +8626,8 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
   if (stsd_len < 24) {
     /* .. but skip stream with empty stsd produced by some Vivotek cameras */
     if (stream->subtype == FOURCC_vivo) {
-      g_free (stream);
+      if (new_stream)
+        gst_qtdemux_stream_free (qtdemux, stream);
       return TRUE;
     } else {
       goto corrupt_file;