MATERIALFV may end up reading up to 4 floats from the passed parameter.
This should really set a GL_INVALID_ENUM error in the cases where it
matters, but does anybody really care?
Found by ASAN in piglit gl-1.0-beginend-coverage.
v2: fix a trivial compiler warning
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
void GLAPIENTRY
_mesa_Materiali(GLenum face, GLenum pname, GLint param )
{
- GLfloat p = (GLfloat) param;
- MATERIALFV(face, pname, &p);
+ GLfloat p[4];
+ p[0] = (GLfloat) param;
+ MATERIALFV(face, pname, p);
}
void GLAPIENTRY