summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-12-08 15:42:13 -0800
committerVinson Lee <[email protected]>2009-12-08 15:42:13 -0800
commita1d46fbea0b40d7edc668ea5993ea4318f37c9f9 (patch)
treed4a8906413e4bc50f90c71fa132d24b663b5daf3 /src/mesa
parentd88f3b946804f9a3e8cad4f8896e6be488fec2b5 (diff)
mesa: Fix array out-of-bounds access by _mesa_TexParameteri.
_mesa_TexParameteri calls set_tex_parameterf, which uses the params argument as an array.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texparam.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 4c1f690ff1c..59c518c7d25 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -644,9 +644,11 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
case GL_TEXTURE_LOD_BIAS:
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
{
- GLfloat fparam = (GLfloat) param;
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
/* convert int param to float */
- need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
+ need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
}
break;
default: