From 6a2e986f070ac1f47971a09d42663519b57d6644 Mon Sep 17 00:00:00 2001 From: Anton Obzhirov Date: Tue, 31 Mar 2015 17:10:45 +0100 Subject: [PATCH] glbasefilter: avoid segfault when gl platform is not available https://bugzilla.gnome.org/show_bug.cgi?id=747124 --- gst-libs/gst/gl/gstglbasefilter.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst-libs/gst/gl/gstglbasefilter.c b/gst-libs/gst/gl/gstglbasefilter.c index e61d7f77d6..838842d8dc 100644 --- a/gst-libs/gst/gl/gstglbasefilter.c +++ b/gst-libs/gst/gl/gstglbasefilter.c @@ -342,6 +342,9 @@ gst_gl_base_filter_decide_allocation (GstBaseTransform * trans, gst_gl_display_get_gl_context_for_thread (filter->display, NULL); if (!filter->context) { filter->context = gst_gl_context_new (filter->display); + if (!filter->context) + goto context_null_error; + if (!gst_gl_context_create (filter->context, filter->priv->other_context, &error)) goto context_error; @@ -362,6 +365,12 @@ context_error: (NULL)); return FALSE; } +context_null_error: + { + GST_ELEMENT_ERROR (trans, RESOURCE, FAILED, + ("Failed to create context."), (NULL)); + return FALSE; + } error: { GST_ELEMENT_ERROR (trans, LIBRARY, INIT,