mirror of
https://github.com/brl/mutter.git
synced 2025-01-10 03:32:34 +00:00
egl: Make sure GError gets set when we return FALSE
The convention is that when a function returns FALSE or NULL, the error will be set. In this file we call set_egl_error but it might not set an error. Code of the form if (egl_do_thing (..., &error)) use_error (error); will crash in those cases. This commit makes sure we always set the error even if EGL doesn't give us an error. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3614>
This commit is contained in:
parent
a816470996
commit
46619573e0
@ -158,7 +158,10 @@ set_egl_error (GError **error)
|
||||
|
||||
error_number = eglGetError ();
|
||||
if (error_number == EGL_SUCCESS)
|
||||
return;
|
||||
{
|
||||
g_warning ("Expected an EGL error but eglGetError returned EGL_SUCCESS");
|
||||
error_number = -1;
|
||||
}
|
||||
|
||||
error_str = get_egl_error_str (error_number);
|
||||
g_set_error_literal (error, META_EGL_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user