]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix segv in nolightmapsearch
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Wed, 20 May 2009 17:59:40 +0000 (17:59 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Wed, 20 May 2009 17:59:40 +0000 (17:59 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@368 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/lightmaps_ydnar.c

index e680fc0ce98d2c9b96472f306d63c0cfff8681cb..958acca02686cd3604d5f79d892877e2c9dfc2ea 100644 (file)
@@ -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 ];