From: havoc Date: Sat, 14 May 2011 17:58:56 +0000 (+0000) Subject: don't crash in dedicated server when parsing shaders with dpreflectcube X-Git-Tag: xonotic-v0.6.0~163^2~395 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e356fe45dd489969d894461876d1701bb02e79f9;p=xonotic%2Fdarkplaces.git don't crash in dedicated server when parsing shaders with dpreflectcube git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11151 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 6c0b6505..a8af5a4d 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3744,7 +3744,7 @@ rtexture_t *R_GetCubemap(const char *basename) if (r_texture_cubemaps[i] != NULL) if (!strcasecmp(r_texture_cubemaps[i]->basename, basename)) return r_texture_cubemaps[i]->texture ? r_texture_cubemaps[i]->texture : r_texture_whitecube; - if (i >= MAX_CUBEMAPS) + if (i >= MAX_CUBEMAPS || !r_main_mempool) return r_texture_whitecube; r_texture_numcubemaps++; r_texture_cubemaps[i] = (cubemapinfo_t *)Mem_Alloc(r_main_mempool, sizeof(cubemapinfo_t));