summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-12-09 17:59:23 -0800
committerVinson Lee <vlee@vmware.com>2009-12-09 17:59:23 -0800
commitb82757880545f8bce471ba8f13c16998888cd4b5 (patch)
tree1b7506f76c7aa2f9e0b9622ae4d223e490e980aa
parent444d1f39108ab4419843f19f76c968cef3398bab (diff)
mesa: Fix array out-of-bounds access by _mesa_TexGend.
_mesa_TexGend calls _mesa_TexGenfv, which uses the params argument as an array.
-rw-r--r--src/mesa/main/texgen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index d3ea7b936b..f9d38215d6 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -181,8 +181,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
void GLAPIENTRY
_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param )
{
- GLfloat p = (GLfloat) param;
- _mesa_TexGenfv( coord, pname, &p );
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ p[1] = p[2] = p[3] = 0.0F;
+ _mesa_TexGenfv( coord, pname, p );
}