hook: Fix crash in eglChooseConfig() without attrs

The attrs might be NULL.

Change-Id: If80c15f12f51cc739ee0177da97ac5ae8ec689d1
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen 2024-05-15 11:47:53 +08:00
parent 751535b76d
commit 3c3843198e

View file

@ -786,6 +786,9 @@ EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig
EGLint list[MAX_EGL_ATTRS];
int i = 0;
if (!attrib_list)
return _eglChooseConfig(dpy, attrib_list, configs, config_size, num_config);
while (attrib_list[i] != EGL_NONE) {
if (i > MAX_EGL_ATTRS - 2)
return EGL_FALSE;