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:51:39 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sun Nov 29 21:17:44 2009 -0500

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

_mesa_TexParameterf calls set_tex_parameterf, which uses the params
argument as an array.
(cherry picked from commit 270d36da146b899d39e08f830fe34b63833a3731)

---

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

diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 416792f..4ce8c85 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -551,8 +551,13 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
       }
       break;
    default:
-      /* this will generate an error if pname is illegal */
-      need_update = set_tex_parameterf(ctx, texObj, pname, &param);
+      {
+         /* this will generate an error if pname is illegal */
+         GLfloat p[4];
+         p[0] = param;
+         p[1] = p[2] = p[3] = 0.0F;
+         need_update = set_tex_parameterf(ctx, texObj, pname, p);
+      }
    }
 
    if (ctx->Driver.TexParameter && need_update) {



More information about the mesa-commit mailing list