diff options
| author | 2017-01-07 23:49:20 +0000 | |
|---|---|---|
| committer | 2017-01-07 23:49:20 +0000 | |
| commit | ccaf6bf34a357bf74accc08f70a42fc81df58248 (patch) | |
| tree | bccb73e1b101d9d147b30c308993021660fb7c8c /opengl/libagl/egl.cpp | |
| parent | ce80f3f4b00455ed3d1c34a34afe323472e481ca (diff) | |
| parent | 64990fc0b9a50cef8a749eadc5a7fde7d400c5ac (diff) | |
Merge "egl: Add NULL check for num_config parameter"
am: 64990fc0b9
Change-Id: I1000300a6ca1a5ee9013f68aacd8541cdfac48b1
Diffstat (limited to 'opengl/libagl/egl.cpp')
| -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); } |