mesa: Fix array out-of-bounds access by _mesa_TexParameterf.

_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
This commit is contained in:
Vinson Lee 2009-11-29 21:17:44 -05:00
parent a201dfb6bf
commit 270d36da14

View file

@ -554,8 +554,13 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
}
break;
default:
/* this will generate an error if pname is illegal */
need_update = set_tex_parameterf(ctx, texObj, pname, &param);
{
/* this will generate an error if pname is illegal */
GLfloat p[4];
p[0] = param;
p[1] = p[2] = p[3] = 0.0F;
need_update = set_tex_parameterf(ctx, texObj, pname, p);
}
}
if (ctx->Driver.TexParameter && need_update) {