Add sanity check for Cg/GLSL attrib indices.
This commit is contained in:
parent
115758a09f
commit
f1db922c26
|
@ -149,6 +149,9 @@ static char cg_alias_define[GFX_MAX_SHADERS][128];
|
||||||
static void gl_cg_reset_attrib(void)
|
static void gl_cg_reset_attrib(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
// Add sanity check that we did not overflow.
|
||||||
|
rarch_assert(cg_attrib_index <= ARRAY_SIZE(cg_attribs));
|
||||||
|
|
||||||
for (i = 0; i < cg_attrib_index; i++)
|
for (i = 0; i < cg_attrib_index; i++)
|
||||||
cgGLDisableClientState(cg_attribs[i]);
|
cgGLDisableClientState(cg_attribs[i]);
|
||||||
cg_attrib_index = 0;
|
cg_attrib_index = 0;
|
||||||
|
|
|
@ -459,6 +459,9 @@ static bool compile_programs(GLuint *gl_prog)
|
||||||
static void gl_glsl_reset_attrib(void)
|
static void gl_glsl_reset_attrib(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
// Add sanity check that we did not overflow.
|
||||||
|
rarch_assert(gl_attrib_index <= ARRAY_SIZE(gl_attribs));
|
||||||
|
|
||||||
for (i = 0; i < gl_attrib_index; i++)
|
for (i = 0; i < gl_attrib_index; i++)
|
||||||
glDisableVertexAttribArray(gl_attribs[i]);
|
glDisableVertexAttribArray(gl_attribs[i]);
|
||||||
gl_attrib_index = 0;
|
gl_attrib_index = 0;
|
||||||
|
|
Loading…
Reference in New Issue