From: divverent Date: Wed, 20 May 2009 17:59:40 +0000 (+0000) Subject: fix segv in nolightmapsearch X-Git-Tag: svn-r421~52 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b81233b07d50c1550d45c5ca08dbe1527cdbbe57;p=xonotic%2Fnetradiant.git fix segv in nolightmapsearch git-svn-id: svn://svn.icculus.org/netradiant/trunk@368 61c419a2-8eb2-4b30-bcec-8cead039b335 --- diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index e680fc0c..958acca0 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -2016,7 +2016,7 @@ static void FindOutLightmaps( rawLightmap_t *lm ) y = 0; /* walk the list of lightmap pages */ - for( i = noLightmapSearch ? numOutLightmaps - LIGHTMAP_RESERVE_COUNT : 0; i < numOutLightmaps; i++ ) + for( i = ((noLightmapSearch && numOutLightmaps >= LIGHTMAP_RESERVE_COUNT) ? (numOutLightmaps - LIGHTMAP_RESERVE_COUNT) : 0); i < numOutLightmaps; i++ ) { /* get the output lightmap */ olm = &outLightmaps[ i ];