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.5.0~174 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a029238ebdab07b6a1fc092e851362f6a04ead2a;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 ::stable-branch::merge=e356fe45dd489969d894461876d1701bb02e79f9 --- diff --git a/gl_rmain.c b/gl_rmain.c index ef4ee010..3f90d9f5 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));