qtdemux: Fix memory leak for corrupted file

Free brands before overriding them.

https://bugzilla.gnome.org/show_bug.cgi?id=756226
This commit is contained in:
Vineeth TM 2015-10-08 14:44:07 +09:00 committed by Sebastian Dröge
parent 4000d97a81
commit b26ce7ba6d

View file

@ -2377,6 +2377,8 @@ qtdemux_parse_ftyp (GstQTDemux * qtdemux, const guint8 * buffer, gint length)
qtdemux->major_brand = QT_FOURCC (buffer + 8);
GST_DEBUG_OBJECT (qtdemux, "major brand: %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (qtdemux->major_brand));
if (qtdemux->comp_brands)
gst_buffer_unref (qtdemux->comp_brands);
buf = qtdemux->comp_brands = gst_buffer_new_and_alloc (length - 16);
gst_buffer_fill (buf, 0, buffer + 16, length - 16);
}