Fix incorrect rgbGen const reading uninitialized memory

If ParseVector fails, color isn't fully set.
This commit is contained in:
Zack Middleton 2014-08-27 20:27:30 -05:00
parent 0853c85e19
commit e5f54c584a
2 changed files with 4 additions and 0 deletions

View file

@ -847,6 +847,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
{ {
vec3_t color; vec3_t color;
VectorClear( color );
ParseVector( text, 3, color ); ParseVector( text, 3, color );
stage->constantColor[0] = 255 * color[0]; stage->constantColor[0] = 255 * color[0];
stage->constantColor[1] = 255 * color[1]; stage->constantColor[1] = 255 * color[1];

View file

@ -1091,6 +1091,8 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
{ {
vec3_t color; vec3_t color;
VectorClear( color );
ParseVector( text, 3, color ); ParseVector( text, 3, color );
stage->constantColor[0] = 255 * color[0]; stage->constantColor[0] = 255 * color[0];
stage->constantColor[1] = 255 * color[1]; stage->constantColor[1] = 255 * color[1];