From 3c3843198ecc0a7a80537fa562faa0b9cfcc3f8a Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Wed, 15 May 2024 11:47:53 +0800 Subject: [PATCH] hook: Fix crash in eglChooseConfig() without attrs The attrs might be NULL. Change-Id: If80c15f12f51cc739ee0177da97ac5ae8ec689d1 Signed-off-by: Jeffy Chen --- hook/hook.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hook/hook.c b/hook/hook.c index 66395c0..7a248ab 100644 --- a/hook/hook.c +++ b/hook/hook.c @@ -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;