From: Brian Paul Date: Thu, 24 Nov 2005 03:48:19 +0000 (+0000) Subject: change error test in _eglParseConfigAttribs() X-Git-Tag: mesa-7.8~8196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1abf1ea8e4cad0f574b059149cb9761f12c4053;p=platform%2Fupstream%2Fmesa.git change error test in _eglParseConfigAttribs() --- diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index ab141dc..eba608b 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -153,8 +153,11 @@ _eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list) } for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) { - EGLint k = attrib_list[i] - FIRST_ATTRIB; - if (k >= 0 && k < MAX_ATTRIBS) { + if (attrib_list[i] >= EGL_BUFFER_SIZE && + attrib_list[i] <= EGL_MAX_SWAP_INTERVAL) { + EGLint k = attrib_list[i] - FIRST_ATTRIB; + assert(k >= 0); + assert(k < MAX_ATTRIBS); config->Attrib[k] = attrib_list[++i]; } else {