From b26ce7ba6de38f4339648be5c8c068d67fa96c6e Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Thu, 8 Oct 2015 14:44:07 +0900 Subject: [PATCH] qtdemux: Fix memory leak for corrupted file Free brands before overriding them. https://bugzilla.gnome.org/show_bug.cgi?id=756226 --- gst/isomp4/qtdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 811523c784..c666eb8e91 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -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); }