From 0661a5aded83424e29d7595c7f8b6eacef16bdbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Feb 2017 15:22:43 +0200 Subject: [PATCH] gltestsrc: Fix potential NULL pointer dereference if we fail without GError Which can happen here if we just propagate an error that happened elsewhere, e.g. FBO failed. CID 1364604 --- ext/gl/gstgltestsrc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/gl/gstgltestsrc.c b/ext/gl/gstgltestsrc.c index 51c709d..83218b4 100644 --- a/ext/gl/gstgltestsrc.c +++ b/ext/gl/gstgltestsrc.c @@ -675,9 +675,13 @@ unsupported_gl_api: } context_error: { - GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, ("%s", error->message), - (NULL)); - g_clear_error (&error); + if (error) { + GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, ("%s", error->message), + (NULL)); + g_clear_error (&error); + } else { + GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL), (NULL)); + } if (src->context) gst_object_unref (src->context); src->context = NULL; -- 2.7.4