summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-01-26 15:35:11 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-01-27 17:21:54 +0200
commit34197068459591acac0891661a328ae756b00da8 (patch)
treef0ba863910a70184fb39860402ee987cd57231ca
parent2e69d106e956673c41cc8f3a798c52af0c5ffd7a (diff)
downloadgstreamer-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.c11
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;
+ }
}