summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Craig <dcraig@brightsign.biz>2016-02-23 18:13:37 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-02-23 18:13:37 +0200
commita5eee1e28a14fb0547b9c9c3fa05199865fb2f06 (patch)
tree9006ab27a1749ead804a85842e7702259dc1c46a
parent72e46a447818a484e24caeecd33915612e4b0be8 (diff)
disparity: Don't assume that get_current_caps() returns non-NULL caps after has_current_caps()
Remove calls to gst_pad_has_current_caps() which then go on to call gst_pad_get_current_caps() as the caps can go to NULL in between. Instead just use gst_pad_get_current_caps() and check for NULL. https://bugzilla.gnome.org/show_bug.cgi?id=759539
-rw-r--r--ext/opencv/gstdisparity.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/opencv/gstdisparity.cpp b/ext/opencv/gstdisparity.cpp
index 28f06a745..3ca9015a3 100644
--- a/ext/opencv/gstdisparity.cpp
+++ b/ext/opencv/gstdisparity.cpp
@@ -416,12 +416,12 @@ gst_disparity_handle_query (GstPad * pad, GstObject * parent, GstQuery * query)
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
g_mutex_lock (&fs->lock);
- if (!gst_pad_has_current_caps (fs->srcpad)) {
+ current_caps = gst_pad_get_current_caps (fs->srcpad);
+ if (current_caps == NULL) {
template_caps = gst_pad_get_pad_template_caps (pad);
gst_query_set_caps_result (query, template_caps);
gst_caps_unref (template_caps);
} else {
- current_caps = gst_pad_get_current_caps (fs->srcpad);
gst_query_set_caps_result (query, current_caps);
gst_caps_unref (current_caps);
}