From: Brian Paul Date: Mon, 7 Jul 2008 20:34:30 +0000 (-0600) Subject: egl: bump up MAX_ATTRIBS, added assertion X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de71e4741d8b4e3719e702431912374f1cb90034;p=mesa.git egl: bump up MAX_ATTRIBS, added assertion --- diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index d12f66245c0..db1c4c10e08 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -6,7 +6,7 @@ #include -#define MAX_ATTRIBS 100 +#define MAX_ATTRIBS 128 #define FIRST_ATTRIB EGL_BUFFER_SIZE @@ -17,7 +17,11 @@ struct _egl_config }; -#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL) +#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) \ + assert((ATTR) - FIRST_ATTRIB < MAX_ATTRIBS); \ + ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL) + + #define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB])