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

Vinson Lee vlee at kemper.freedesktop.org
Tue Dec 8 23:48:59 UTC 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Dec  8 15:42:13 2009 -0800

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

_mesa_TexParameteri calls set_tex_parameterf, 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 4c1f690..59c518c 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -644,9 +644,11 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
    case GL_TEXTURE_LOD_BIAS:
    case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
       {
-         GLfloat fparam = (GLfloat) param;
+         GLfloat fparam[4];
+         fparam[0] = (GLfloat) param;
+         fparam[1] = fparam[2] = fparam[3] = 0.0F;
          /* convert int param to float */
-         need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
+         need_update = set_tex_parameterf(ctx, texObj, pname, fparam);
       }
       break;
    default:




More information about the mesa-commit mailing list