[quake3-commits] r1809 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 21 20:10:35 EST 2011


Author: thilo
Date: 2011-01-21 20:10:34 -0500 (Fri, 21 Jan 2011)
New Revision: 1809

Modified:
   trunk/code/renderer/tr_shader.c
Log:
Fix potential segfault when no PK3s have been loaded (may happen when compiled with -DSTANDALONE)


Modified: trunk/code/renderer/tr_shader.c
===================================================================
--- trunk/code/renderer/tr_shader.c	2011-01-21 20:47:32 UTC (rev 1808)
+++ trunk/code/renderer/tr_shader.c	2011-01-22 01:10:34 UTC (rev 1809)
@@ -2327,6 +2327,9 @@
 
 	hash = generateHashValue(shadername, MAX_SHADERTEXT_HASH);
 
+	if(!shaderTextHashTable[hash])
+		return NULL;
+
 	for (i = 0; shaderTextHashTable[hash][i]; i++) {
 		p = shaderTextHashTable[hash][i];
 		token = COM_ParseExt(&p, qtrue);



More information about the quake3-commits mailing list