mesa: Fix array out-of-bounds access in _mesa_TexEnvf.
authorVinson Lee <vlee@vmware.com>
Sun, 29 Nov 2009 03:04:06 +0000 (22:04 -0500)
committerVinson Lee <vlee@vmware.com>
Sat, 5 Dec 2009 01:48:30 +0000 (17:48 -0800)
_mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument
as an array.
(cherry picked from commit a11d60d14caf8efc07f70af63b57b33273f8cf9b)

src/mesa/main/texenv.c

index 6d86a4275cc4c05b82a764fbe3435454b18cdfd0..4442fb8cf8e9877a55bc085d313bcdb2a1d6f3ce 100644 (file)
@@ -598,7 +598,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
 void GLAPIENTRY
 _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param )
 {
-   _mesa_TexEnvfv( target, pname, &param );
+   GLfloat p[4];
+   p[0] = param;
+   p[1] = p[2] = p[3] = 0.0;
+   _mesa_TexEnvfv( target, pname, p );
 }