Mesa (mesa_7_6_branch): mesa: Fix array out-of-bounds access by _mesa_Lightf.

Vinson Lee vlee at kemper.freedesktop.org
Wed Dec 9 17:42:34 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 34528a34c446afea4442f479713e7f926220f128
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34528a34c446afea4442f479713e7f926220f128

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Dec  9 17:11:30 2009 -0800

mesa: Fix array out-of-bounds access by _mesa_Lightf.

---

 src/mesa/main/light.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index c1d47de..d4f3bb9 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params)
 void GLAPIENTRY
 _mesa_Lightf( GLenum light, GLenum pname, GLfloat param )
 {
-   _mesa_Lightfv( light, pname, &param );
+   GLfloat fparam[4];
+   fparam[0] = param;
+   fparam[1] = fparam[2] = fparam[3] = 0.0F;
+   _mesa_Lightfv( light, pname, fparam );
 }
 
 



More information about the mesa-commit mailing list