From: eihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sat, 1 Oct 2011 02:01:07 +0000 (+0000)
Subject: fix crash when compiling shadowmaps for certain Q3BSP files with no faces
X-Git-Tag: xonotic-v0.6.0~294
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=972002cae9adcb48bc264dd880a37e2bad3ee35c;p=xonotic%2Fdarkplaces.git

fix crash when compiling shadowmaps for certain Q3BSP files with no faces

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11379 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=e86ad109f5b381e160458c049bd9351800ccb32f
---

diff --git a/gl_rsurf.c b/gl_rsurf.c
index 4f7d7f3d..402208d7 100644
--- a/gl_rsurf.c
+++ b/gl_rsurf.c
@@ -1353,6 +1353,8 @@ void R_Q1BSP_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin,
 	int surfacelistindex;
 	int sidetotals[6] = { 0, 0, 0, 0, 0, 0 }, sidemasks = 0;
 	int i;
+	if (!model->brush.shadowmesh)
+		return;
 	r_shadow_compilingrtlight->static_meshchain_shadow_shadowmap = Mod_ShadowMesh_Begin(r_main_mempool, 32768, 32768, NULL, NULL, NULL, false, false, true);
 	R_Shadow_PrepareShadowSides(model->brush.shadowmesh->numtriangles);
 	for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)