]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
don't crash in dedicated server when parsing shaders with dpreflectcube
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2011 17:58:56 +0000 (17:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2011 17:58:56 +0000 (17:58 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11151 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 6c0b6505e35f681a4ca019ae2cbd9967f13b9b57..a8af5a4d91754fef62c5f32abab68a687dd03b8d 100644 (file)
@@ -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));