aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fog.c
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-12-08 16:04:33 -0800
committerVinson Lee <[email protected]>2009-12-08 16:08:41 -0800
commit7f146b38240e1c4efa6d8d0a4e5a0c8346706de5 (patch)
treefdbb29db967fca20aeb2eb2672c2819ddb733666 /src/mesa/main/fog.c
parenta1d46fbea0b40d7edc668ea5993ea4318f37c9f9 (diff)
mesa: Fix array out-of-bounds access by _mesa_Fogi.
_mesa_Fogi calls _mesa_Fogfv, which uses the params argument as an array.
Diffstat (limited to 'src/mesa/main/fog.c')
-rw-r--r--src/mesa/main/fog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 4323d3db820..99eb141812e 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -41,8 +41,10 @@ _mesa_Fogf(GLenum pname, GLfloat param)
void GLAPIENTRY
_mesa_Fogi(GLenum pname, GLint param )
{
- GLfloat fparam = (GLfloat) param;
- _mesa_Fogfv(pname, &fparam);
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ _mesa_Fogfv(pname, fparam);
}