summaryrefslogtreecommitdiff
path: root/opengl/libagl/egl.cpp
diff options
context:
space:
mode:
author Jesse Hall <jessehall@google.com> 2017-01-07 23:53:50 +0000
committer android-build-merger <android-build-merger@google.com> 2017-01-07 23:53:50 +0000
commit68d96292a69c934de36495e717ca7859793ffb4a (patch)
tree951cf71facd74bf6aa4c699984cec859ca5b0533 /opengl/libagl/egl.cpp
parente6545f3cf3923aeb634184022bb5c2ca139e3bff (diff)
parentccaf6bf34a357bf74accc08f70a42fc81df58248 (diff)
Merge "egl: Add NULL check for num_config parameter" am: 64990fc0b9
am: ccaf6bf34a Change-Id: Ifada0489e548bbbfa7378b408a1268b7a7b4da03
Diffstat (limited to 'opengl/libagl/egl.cpp')
-rw-r--r--opengl/libagl/egl.cpp7
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);
}