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

Vinson Lee vlee at kemper.freedesktop.org
Tue Dec 8 14:39:38 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Dec  8 14:31:38 2009 -0800

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

_mesa_TexParameterfv calls set_tex_parameteri, which uses the
params argument as an array.

---

 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 4ce8c85..4c1f690 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -592,8 +592,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
    case GL_DEPTH_TEXTURE_MODE_ARB:
       {
          /* convert float param to int */
-         GLint p = (GLint) params[0];
-         need_update = set_tex_parameteri(ctx, texObj, pname, &p);
+         GLint p[4];
+         p[0] = (GLint) params[0];
+         p[1] = p[2] = p[3] = 0;
+         need_update = set_tex_parameteri(ctx, texObj, pname, p);
       }
       break;
 



More information about the mesa-commit mailing list