mesa: Prevent possible array out-of-bounds access by _mesa_light.

This commit is contained in:
Vinson Lee 2010-01-04 12:06:04 -08:00
parent e661bf5018
commit 6130bb1391
1 changed files with 32 additions and 15 deletions

View File

@ -1050,14 +1050,31 @@ _mesa_PopAttrib(void)
_mesa_light(ctx, i, GL_SPECULAR, l->Specular );
_mesa_light(ctx, i, GL_POSITION, l->EyePosition);
_mesa_light(ctx, i, GL_SPOT_DIRECTION, l->SpotDirection);
_mesa_light(ctx, i, GL_SPOT_EXPONENT, &l->SpotExponent);
_mesa_light(ctx, i, GL_SPOT_CUTOFF, &l->SpotCutoff);
_mesa_light(ctx, i, GL_CONSTANT_ATTENUATION,
&l->ConstantAttenuation);
_mesa_light(ctx, i, GL_LINEAR_ATTENUATION,
&l->LinearAttenuation);
_mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION,
&l->QuadraticAttenuation);
{
GLfloat p[4] = { 0 };
p[0] = l->SpotExponent;
_mesa_light(ctx, i, GL_SPOT_EXPONENT, p);
}
{
GLfloat p[4] = { 0 };
p[0] = l->SpotCutoff;
_mesa_light(ctx, i, GL_SPOT_CUTOFF, p);
}
{
GLfloat p[4] = { 0 };
p[0] = l->ConstantAttenuation;
_mesa_light(ctx, i, GL_CONSTANT_ATTENUATION, p);
}
{
GLfloat p[4] = { 0 };
p[0] = l->LinearAttenuation;
_mesa_light(ctx, i, GL_LINEAR_ATTENUATION, p);
}
{
GLfloat p[4] = { 0 };
p[0] = l->QuadraticAttenuation;
_mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION, p);
}
}
/* light model */
_mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,