libs: egl: utils: mark context as wrapped when it is

The returning egl context may be null, so we should check the
return value.

https://bugzilla.gnome.org/show_bug.cgi?id=795391
This commit is contained in:
Hyunjun Ko 2018-04-24 18:12:44 +09:00 committed by Víctor Manuel Jáquez Leal
parent 9fde93f80c
commit 4af46f00c2

View file

@ -1117,11 +1117,15 @@ egl_context_new_wrapped (EglDisplay * display, EGLContext gl_context)
args.display = display;
args.config = config;
args.gl_parent_context = gl_context;
args.context = NULL;
success = egl_display_run (display, (EglContextRunFunc) do_egl_context_new,
&args);
egl_object_unref (config);
if (!success)
return NULL;
if (args.context)
args.context->base.is_wrapped = TRUE;
return args.context;
}