From fe59f50468b8fc4f22b5c29487d64ed1b0026e76 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 8 Feb 2011 12:31:34 +0200 Subject: [PATCH] decodebin2: caps can be NULL Don't use and unref NULL caps. --- gst/playback/gstdecodebin2.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 064d62e..673e9b4 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -3064,13 +3064,15 @@ gst_decode_chain_get_topology (GstDecodeChain * chain) for (; l && l->next; l = l->next) { GstCaps *caps = _gst_element_get_linked_caps (l->next->data, l->data); - s = gst_structure_id_empty_new (topology_structure_name); - gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, caps, NULL); - gst_caps_unref (caps); + if (caps) { + s = gst_structure_id_empty_new (topology_structure_name); + gst_structure_id_set (u, topology_caps, GST_TYPE_CAPS, caps, NULL); + gst_caps_unref (caps); - gst_structure_id_set (s, topology_next, GST_TYPE_STRUCTURE, u, NULL); - gst_structure_free (u); - u = s; + gst_structure_id_set (s, topology_next, GST_TYPE_STRUCTURE, u, NULL); + gst_structure_free (u); + u = s; + } } /* Caps that resulted in this chain */ -- 2.7.4