mesa: Fix array out-of-bounds access by _mesa_TexParameteriv.
authorVinson Lee <vlee@vmware.com>
Thu, 10 Dec 2009 20:11:09 +0000 (12:11 -0800)
committerVinson Lee <vlee@vmware.com>
Thu, 10 Dec 2009 20:11:09 +0000 (12:11 -0800)
src/mesa/main/texparam.c

index 1cec4b82fea8c5481ff7e177450cfa7b2c6077e5..0f83d226f28b6451ac9e6c8e7eabca14cb09d6b8 100644 (file)
@@ -700,8 +700,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
    case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
       {
          /* convert int param to float */
-         GLfloat fparam = (GLfloat) params[0];
-         need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
+         GLfloat fparams[4];
+         fparams[0] = (GLfloat) params[0];
+         fparams[1] = fparams[2] = fparams[3] = 0.0F;
+         need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
       }
       break;
    default: