summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli Nieminen <pauli.nieminen@linux.intel.com>2012-01-04 16:25:10 +0200
committerChih-Wei Huang <cwhuang@linux.org.tw>2016-05-06 01:55:11 +0800
commitdd07995c754e7281e788d24f66b7363afa173c4f (patch)
treeba55e33f684b661c715f76f0b159cbe3089f136a
parent89d25d084d29fb0313f3af39a723453d032ed3b2 (diff)
downloadframeworks_native-dd07995c754e7281e788d24f66b7363afa173c4f.zip
frameworks_native-dd07995c754e7281e788d24f66b7363afa173c4f.tar.gz
frameworks_native-dd07995c754e7281e788d24f66b7363afa173c4f.tar.bz2
egl: Add NULL check for eglGetconfigs num_config parameter
EGL 1.4 specification says in 3.4.1: "An EGL_BAD_PARAMETER error is generated if num config is NULL." We have to check for the condition and return the required error to application. Change-Id: Ib42709f0420161ce661536394d4c0779bc62be57 Original-Change-Id: I4fe670c4362f4ae494f91d69ae105e29ccf3c769 Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
-rw-r--r--opengl/libagl/egl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 593d0c2..58aeabb 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -1468,6 +1468,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==0))
+ return setError(EGL_BAD_PARAMETER, EGL_FALSE);
+
GLint numConfigs = NELEM(gConfigs);
if (!configs) {
*num_config = numConfigs;