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

Vinson Lee vlee at kemper.freedesktop.org
Sat Dec 5 12:50:31 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sun Nov 29 18:18:23 2009 -0500

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

_mesa_TexParameterf calls set_tex_parameteri, which uses the params
argument as an array.
(cherry picked from commit a201dfb6bf28b89d6f511c2ec9ae0d81ef18511d)

---

 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 9d1fdd0..416792f 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -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:



More information about the mesa-commit mailing list