From 7f146b38240e1c4efa6d8d0a4e5a0c8346706de5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 16:04:33 -0800 Subject: [PATCH] mesa: Fix array out-of-bounds access by _mesa_Fogi. _mesa_Fogi calls _mesa_Fogfv, which uses the params argument as an array. --- src/mesa/main/fog.c | 6 ++++-- 1 file 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); } -- 2.30.2