summaryrefslogtreecommitdiff
path: root/gst/videocrop
diff options
context:
space:
mode:
authorDave Craig <dcraig@brightsign.biz>2015-12-16 12:40:39 +0000
committerSebastian Dröge <sebastian@centricular.com>2016-02-23 18:11:42 +0200
commit211c8492b35d1e58033d9104ec8b52d497f475fb (patch)
treed288d1b1e858c6a4754f8f23fae5d462ef69a42a /gst/videocrop
parent6cdbf406224494335940b2ac9ab9354453406ed3 (diff)
downloadgstreamer-plugins-good-211c8492b35d1e58033d9104ec8b52d497f475fb.tar.gz
gst: 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
Diffstat (limited to 'gst/videocrop')
-rw-r--r--gst/videocrop/gstaspectratiocrop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/videocrop/gstaspectratiocrop.c b/gst/videocrop/gstaspectratiocrop.c
index 10d0499aa..037d32645 100644
--- a/gst/videocrop/gstaspectratiocrop.c
+++ b/gst/videocrop/gstaspectratiocrop.c
@@ -464,8 +464,10 @@ gst_aspect_ratio_crop_set_property (GObject * object, guint prop_id,
if (recheck) {
GstCaps *caps = gst_pad_get_current_caps (aspect_ratio_crop->sink);
- gst_aspect_ratio_crop_set_caps (aspect_ratio_crop, caps);
- gst_caps_unref (caps);
+ if (caps != NULL) {
+ gst_aspect_ratio_crop_set_caps (aspect_ratio_crop, caps);
+ gst_caps_unref (caps);
+ }
}
}