diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-01-26 15:35:11 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-01-27 17:21:54 +0200 |
commit | 34197068459591acac0891661a328ae756b00da8 (patch) | |
tree | f0ba863910a70184fb39860402ee987cd57231ca | |
parent | 2e69d106e956673c41cc8f3a798c52af0c5ffd7a (diff) | |
download | gstreamer-plugins-bad-34197068459591acac0891661a328ae756b00da8.tar.gz |
applemedia: Fail cleanly instead of crashing if obtaining a GL display failed
https://bugzilla.gnome.org/show_bug.cgi?id=777742
-rw-r--r-- | sys/applemedia/glcontexthelper.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/applemedia/glcontexthelper.c b/sys/applemedia/glcontexthelper.c index 4e6f6175e..4e0b71ed8 100644 --- a/sys/applemedia/glcontexthelper.c +++ b/sys/applemedia/glcontexthelper.c @@ -92,6 +92,9 @@ gst_gl_context_helper_ensure_context (GstGLContextHelper * ctxh) gst_gl_ensure_element_data (ctxh->element, &ctxh->display, &ctxh->other_context); + if (!ctxh->display) + goto display_error; + context = _find_local_gl_context (ctxh); if (context) { GST_INFO_OBJECT (ctxh->element, "found local context %p, old context %p", @@ -129,4 +132,12 @@ context_error: return; } + +display_error: + { + GST_ELEMENT_ERROR (ctxh->element, RESOURCE, NOT_FOUND, + ("Failed to obtain display"), (NULL)); + + return; + } } |