diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 4ec4ec19e2..68e162253e 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -744,7 +744,8 @@ _ensure_gl_setup (GstGLImageSink * gl_sink) GST_PTR_FORMAT, gl_sink->context, other_context); if (!gst_gl_context_create (gl_sink->context, other_context, &error)) { - gst_object_unref (other_context); + if (other_context) + gst_object_unref (other_context); gst_object_unref (window); goto context_error; }