diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-05-19 12:25:51 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-05-19 12:25:51 +0200 |
commit | 8070b4e043bd863a87605dad5908c1e04b9bdafc (patch) | |
tree | d0abc57b3cb01a43de617dabfe7cc7cd80c89eaf /ext | |
parent | 911ec0d3ef4850a2978d10a9c9de667f65ae587b (diff) | |
download | gstreamer-plugins-bad-8070b4e043bd863a87605dad5908c1e04b9bdafc.tar.gz |
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
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gl/gstglimagesink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 1dbc5ec40..b2a1d07c4 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -388,6 +388,8 @@ _ensure_gl_setup (GstGLImageSink * gl_sink) GstGLWindow *window; 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); @@ -421,6 +423,13 @@ _ensure_gl_setup (GstGLImageSink * gl_sink) return TRUE; +context_creation_error: + { + GST_ELEMENT_ERROR (gl_sink, RESOURCE, NOT_FOUND, + ("Failed to create GL context"), (NULL)); + return FALSE; + } + context_error: { GST_ELEMENT_ERROR (gl_sink, RESOURCE, NOT_FOUND, ("%s", error->message), |