qtdemux: fix caps leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 14 Oct 2015 10:03:15 +0000 (12:03 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 17 Oct 2015 08:03:17 +0000 (11:03 +0300)
If the QtDemuxStream are re-used they may already have caps which used
to be leaked.

Reproduced using the
validate.dash.playback.seek_forward.dash_exMPD_BIP_TC1 validate
scenario.

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

gst/isomp4/qtdemux.c

index 0425d94..d727a54 100644 (file)
@@ -8777,6 +8777,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
       }
     }
 
+    if (stream->caps)
+      gst_caps_unref (stream->caps);
+
     stream->caps =
         qtdemux_video_caps (qtdemux, stream, fourcc, stsd_data, &codec);
     if (G_UNLIKELY (!stream->caps)) {
@@ -9507,6 +9510,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
       GST_WARNING_OBJECT (qtdemux, "unknown audio STSD version %08x", version);
     }
 
+    if (stream->caps)
+      gst_caps_unref (stream->caps);
+
     stream->caps = qtdemux_audio_caps (qtdemux, stream, fourcc,
         stsd_data + 32, len - 16, &codec);