gl: check null before unref GstGLDisplay
authorWang Xin-yu (王昕宇) <comicfans44@gmail.com>
Wed, 20 Aug 2014 01:37:01 +0000 (09:37 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:45 +0000 (19:31 +0000)
gst-libs/gst/gl/gstglutils.c

index 2e1b0dd..c2ea06f 100644 (file)
@@ -770,7 +770,9 @@ gst_gl_handle_set_context (GstElement * element, GstContext * context,
   if (replacement) {
     GstGLDisplay *old = *display;
     *display = replacement;
-    gst_object_unref (old);
+
+    if (old)
+      gst_object_unref (old);
   }
 
   return TRUE;