summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-02-10 18:58:32 +1100
committerMatthew Waters <matthew@centricular.com>2016-02-17 01:13:43 +1100
commit22172df4132e4f0d390d0f16ba7bbefb19d36e5f (patch)
tree528efbc8d494b923505997063b6eea2f728e40a4 /ext
parentb5dce08d8f4bb284bc1a5a28bf7bcc54053e835d (diff)
downloadgstreamer-plugins-bad-22172df4132e4f0d390d0f16ba7bbefb19d36e5f.tar.gz
vksink: only unref if the pointers are non-NULL
Diffstat (limited to 'ext')
-rw-r--r--ext/vulkan/vksink.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/vulkan/vksink.c b/ext/vulkan/vksink.c
index f3eff34f2..f0837e684 100644
--- a/ext/vulkan/vksink.c
+++ b/ext/vulkan/vksink.c
@@ -299,16 +299,22 @@ gst_vulkan_sink_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PAUSED_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_NULL:
- gst_object_unref (vk_sink->swapper);
+ if (vk_sink->swapper)
+ gst_object_unref (vk_sink->swapper);
vk_sink->swapper = NULL;
- gst_object_unref (vk_sink->display);
+ if (vk_sink->display)
+ gst_object_unref (vk_sink->display);
vk_sink->display = NULL;
- gst_vulkan_window_close (vk_sink->window);
- gst_object_unref (vk_sink->window);
+ if (vk_sink->window) {
+ gst_vulkan_window_close (vk_sink->window);
+ gst_object_unref (vk_sink->window);
+ }
vk_sink->window = NULL;
- gst_object_unref (vk_sink->device);
+ if (vk_sink->device)
+ gst_object_unref (vk_sink->device);
vk_sink->device = NULL;
- gst_object_unref (vk_sink->instance);
+ if (vk_sink->instance)
+ gst_object_unref (vk_sink->instance);
vk_sink->instance = NULL;
break;
default: