]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prevent crashes on BIH code
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Mar 2011 21:11:04 +0000 (21:11 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Mar 2011 21:11:04 +0000 (21:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10965 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 4db0a5035db97d1a0e4f79be2c6ba3b20ba24bdc..a5c0c1ce30a5db57f7a4c3f6e432cf7113d67784 100644 (file)
@@ -7067,7 +7067,7 @@ bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t
        }
 
        // allocate buffers for the produced and temporary data
-       bihmaxnodes = bihnumleafs - 1;
+       bihmaxnodes = bihnumleafs + 1;
        bihnodes = (bih_node_t *)Mem_Alloc(loadmodel->mempool, sizeof(bih_node_t) * bihmaxnodes);
        temp_leafsort = (int *)Mem_Alloc(loadmodel->mempool, sizeof(int) * bihnumleafs * 2);
        temp_leafsortscratch = temp_leafsort + bihnumleafs;