diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 2e1b0dd4cf..c2ea06fab2 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -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;