From ac89e531735ec7293c4f907a69ed6a965a1a9392 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Sat, 14 Mar 2015 12:58:22 +0000 Subject: [PATCH] glimagesink: Add NULL check in error case Other context may be NULL if something went wrong. Avoid trying to unref a NULL pointer. --- ext/gl/gstglimagesink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }