r168 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Oct 19 21:23:17 EDT 2005


Author: tma
Date: 2005-10-19 21:23:17 -0400 (Wed, 19 Oct 2005)
New Revision: 168

Modified:
   trunk/code/renderer/tr_shader.c
Log:
* Fixed the fix for the shader overrun. If this isn't a case for unified diffs,
  I don't know what is :).


Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2005-10-19 22:25:32 UTC (rev 167)
+++ trunk/code/renderer/tr_shader.c	2005-10-20 01:23:17 UTC (rev 168)
@@ -1432,6 +1432,12 @@
 		// 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 @@
 			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




More information about the quake3-commits mailing list