mesa: Fix array out-of-bounds access by _mesa_Fogf.
authorVinson Lee <vlee@vmware.com>
Wed, 9 Dec 2009 01:51:07 +0000 (17:51 -0800)
committerVinson Lee <vlee@vmware.com>
Wed, 9 Dec 2009 01:51:07 +0000 (17:51 -0800)
_mesa_Fogf calls _mesa_Fogfv, which uses the params argument
as an array.

src/mesa/main/fog.c

index 99eb141812eed3b47c473e5d6e0541ac13834cb1..269ff3f8b993bf5a33e11df4aec7bae83ac3f978 100644 (file)
 void GLAPIENTRY
 _mesa_Fogf(GLenum pname, GLfloat param)
 {
-   _mesa_Fogfv(pname, &param);
+   GLfloat fparam[4];
+   fparam[0] = param;
+   fparam[1] = fparam[2] = fparam[3] = 0.0F;
+   _mesa_Fogfv(pname, fparam);
 }