mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
glimagesink: Check if context creation failed before trying to use it
Otherwise we will cause assertions everywhere by passing NULL to functions and eventually crash when dereferencing a NULL pointer. https://bugzilla.gnome.org/show_bug.cgi?id=730069
This commit is contained in:
parent
911ec0d3ef
commit
8070b4e043
1 changed files with 9 additions and 0 deletions
|
@ -388,6 +388,8 @@ _ensure_gl_setup (GstGLImageSink * gl_sink)
|
||||||
GstGLWindow *window;
|
GstGLWindow *window;
|
||||||
|
|
||||||
gl_sink->context = gst_gl_context_new (gl_sink->display);
|
gl_sink->context = gst_gl_context_new (gl_sink->display);
|
||||||
|
if (!gl_sink->context)
|
||||||
|
goto context_creation_error;
|
||||||
|
|
||||||
window = gst_gl_context_get_window (gl_sink->context);
|
window = gst_gl_context_get_window (gl_sink->context);
|
||||||
|
|
||||||
|
@ -421,6 +423,13 @@ _ensure_gl_setup (GstGLImageSink * gl_sink)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
context_creation_error:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (gl_sink, RESOURCE, NOT_FOUND,
|
||||||
|
("Failed to create GL context"), (NULL));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
context_error:
|
context_error:
|
||||||
{
|
{
|
||||||
GST_ELEMENT_ERROR (gl_sink, RESOURCE, NOT_FOUND, ("%s", error->message),
|
GST_ELEMENT_ERROR (gl_sink, RESOURCE, NOT_FOUND, ("%s", error->message),
|
||||||
|
|
Loading…
Reference in a new issue