From fdb66505bfcb6bf24f4c1de5239f590b7a8426e6 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 22 Jan 2011 01:10:34 +0000 Subject: [PATCH] Fix potential segfault when no PK3s have been loaded (may happen when compiled with -DSTANDALONE) --- code/renderer/tr_shader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index 1a68e820..75563d93 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -2327,6 +2327,9 @@ static char *FindShaderInShaderText( const char *shadername ) { 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);