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
This commit is contained in:
Sebastian Dröge 2017-02-28 15:22:43 +02:00
parent a064590912
commit 0661a5aded

View file

@ -675,9 +675,13 @@ unsupported_gl_api:
} }
context_error: context_error:
{ {
if (error) {
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, ("%s", error->message), GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, ("%s", error->message),
(NULL)); (NULL));
g_clear_error (&error); g_clear_error (&error);
} else {
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL), (NULL));
}
if (src->context) if (src->context)
gst_object_unref (src->context); gst_object_unref (src->context);
src->context = NULL; src->context = NULL;