[0.10] gst-plugins-base: discoverer: fix potential caps leak
Tim Müller
tpm at kemper.freedesktop.org
Thu Jan 12 09:48:35 PST 2012
Module: gst-plugins-base
Branch: 0.10
Commit: 7af6c6012bd15d6a5266ca5d695cdefbd382bf14
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=7af6c6012bd15d6a5266ca5d695cdefbd382bf14
Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date: Tue Jan 10 17:48:44 2012 +0000
discoverer: fix potential caps leak
in last else chunk.
---
gst-libs/gst/pbutils/gstdiscoverer.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index 581739e..a7c4968 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -908,24 +908,21 @@ parse_stream_topology (GstDiscoverer * dc, const GstStructure * topology,
/* We sometimes get an extra sub-stream from the parser. If this is
* the case, we just replace the parent caps with this stream's caps
* since they might contain more information */
- gst_caps_unref (parent->caps);
- parent->caps = caps;
+ gst_caps_replace (&parent->caps, caps);
parse_stream_topology (dc, st, parent);
add_to_list = FALSE;
-
} else if (child_is_raw_stream (parent->caps, caps)) {
/* This is the "raw" stream corresponding to the parent. This
* contains more information than the parent, tags etc. */
parse_stream_topology (dc, st, parent);
add_to_list = FALSE;
- gst_caps_unref (caps);
-
} else {
GstDiscovererStreamInfo *next = parse_stream_topology (dc, st, NULL);
res->next = next;
next->previous = res;
}
+ gst_caps_unref (caps);
}
}
More information about the gstreamer-commits
mailing list