Mesa (mesa_7_6_branch): mesa: Fix array out-of-bounds access by _mesa_TexParameteriv.

Vinson Lee vlee at kemper.freedesktop.org
Thu Dec 10 20:12:28 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: dcb4a37fc89924192d923ed6906d2922371b8cb1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dcb4a37fc89924192d923ed6906d2922371b8cb1

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Dec 10 12:11:09 2009 -0800

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

---

 src/mesa/main/texparam.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 1cec4b8..0f83d22 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -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:




More information about the mesa-commit mailing list