From bb9a8a9b7d78e6bf8aa848ea40080999f0daf0d4 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 5 Oct 2010 16:01:19 +0200 Subject: [PATCH] matroskademux: only unref buffer when no longer needed for cluster scanning Fixes #629047. --- gst/matroska/matroska-demux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 9ed6892..979ae3f 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -2353,8 +2353,6 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos) newpos += cluster_pos; GST_DEBUG_OBJECT (demux, "found cluster ebml id at offset %" G_GINT64_FORMAT, newpos); - gst_buffer_unref (buf); - buf = NULL; /* extra checks whether we really sync'ed to a cluster: * - either it is the first and only cluster * - either there is a cluster after this one @@ -2398,6 +2396,11 @@ gst_matroska_demux_search_cluster (GstMatroskaDemux * demux, gint64 * pos) } } + if (buf) { + gst_buffer_unref (buf); + buf = NULL; + } + demux->offset = orig_offset; *pos = newpos; return ret; -- 2.7.4