From 653c5621acda9733bc84528c9bc36bcc7a8476be Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 20 Oct 2005 01:23:17 +0000 Subject: [PATCH] * Fixed the fix for the shader overrun. If this isn't a case for unified diffs, I don't know what is :). --- code/renderer/tr_shader.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index f896f31a..7e9a37ef 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -1432,6 +1432,12 @@ static qboolean ParseShader( char **text ) // stage definition else if ( token[0] == '{' ) { + // 20051019 misantropia -- fix buffer overrun. + if ( s >= MAX_SHADER_STAGES ) { + ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s\n", shader.name ); + return qfalse; + } + if ( !ParseStage( &stages[s], text ) ) { return qfalse; @@ -1439,12 +1445,6 @@ static qboolean ParseShader( char **text ) stages[s].active = qtrue; s++; - // 20051019 misantropia -- fix buffer overrun. - if ( s >= MAX_SHADER_STAGES ) { - ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s\n", shader.name ); - return qfalse; - } - continue; } // skip stuff that only the QuakeEdRadient needs