From: Vinson Lee Date: Tue, 8 Dec 2009 23:42:13 +0000 (-0800) Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteri. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1d46fbea0b40d7edc668ea5993ea4318f37c9f9;p=mesa.git mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameterf, which uses the params argument as an array. --- 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: