diff options
author | 2017-01-07 23:44:22 +0000 | |
---|---|---|
committer | 2017-01-07 23:44:23 +0000 | |
commit | 64990fc0b9a50cef8a749eadc5a7fde7d400c5ac (patch) | |
tree | bccb73e1b101d9d147b30c308993021660fb7c8c | |
parent | 3944ec426b766807cd230ca66d485dc6a0f60f89 (diff) | |
parent | d8cf2ce6b8b2f29e24d8185a36618dd33a17cf8e (diff) |
Merge "egl: Add NULL check for num_config parameter"
-rw-r--r-- | opengl/libagl/egl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index bb20409819..4e9cb5b6d2 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -1459,6 +1459,9 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy, if (egl_display_t::is_valid(dpy) == EGL_FALSE) return setError(EGL_BAD_DISPLAY, EGL_FALSE); + if (ggl_unlikely(num_config==NULL)) + return setError(EGL_BAD_PARAMETER, EGL_FALSE); + GLint numConfigs = NELEM(gConfigs); if (!configs) { *num_config = numConfigs; @@ -1478,8 +1481,8 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, { if (egl_display_t::is_valid(dpy) == EGL_FALSE) return setError(EGL_BAD_DISPLAY, EGL_FALSE); - - if (ggl_unlikely(num_config==0)) { + + if (ggl_unlikely(num_config==NULL)) { return setError(EGL_BAD_PARAMETER, EGL_FALSE); } |