mesa: Fix array out-of-bounds access by _mesa_TexParameterf.
authorVinson Lee <vlee@vmware.com>
Sun, 29 Nov 2009 23:18:23 +0000 (18:18 -0500)
committerVinson Lee <vlee@vmware.com>
Sat, 5 Dec 2009 20:47:40 +0000 (12:47 -0800)
_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
(cherry picked from commit a201dfb6bf28b89d6f511c2ec9ae0d81ef18511d)

src/mesa/main/texparam.c

index 9d1fdd0566402f33e76768284bf202b8546f12d8..416792f0e99f7453172ff8c8b60fdfea17ffb67e 100644 (file)
@@ -544,8 +544,10 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
    case GL_DEPTH_TEXTURE_MODE_ARB:
       {
          /* convert float param to int */
-         GLint p = (GLint) param;
-         need_update = set_tex_parameteri(ctx, texObj, pname, &p);
+         GLint p[4];
+         p[0] = (GLint) param;
+         p[1] = p[2] = p[3] = 0;
+         need_update = set_tex_parameteri(ctx, texObj, pname, p);
       }
       break;
    default: