r170 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Oct 20 12:19:44 EDT 2005


Author: tma
Date: 2005-10-20 12:19:43 -0400 (Thu, 20 Oct 2005)
New Revision: 170

Modified:
   trunk/code/renderer/tr_shader.c
Log:
* Fix to potential out of range index bug from misanthropia


Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2005-10-20 16:14:05 UTC (rev 169)
+++ trunk/code/renderer/tr_shader.c	2005-10-20 16:19:43 UTC (rev 170)
@@ -2566,7 +2566,14 @@
 	shader_t	*sh;
 
 	hash = generateHashValue(name, FILE_HASH_SIZE);
-	
+
+	// 20051020 misantropia -- probably not necessary since this function
+	// only gets called from tr_font.c with lightmapIndex == LIGHTMAP_2D
+	// but better safe than sorry.
+	if ( lightmapIndex >= tr.numLightmaps ) {
+		lightmapIndex = LIGHTMAP_WHITEIMAGE;
+	}
+
 	//
 	// see if the shader is already loaded
 	//




More information about the quake3-commits mailing list