From: havoc Date: Fri, 25 Mar 2011 21:11:04 +0000 (+0000) Subject: prevent crashes on BIH code X-Git-Tag: xonotic-v0.6.0~163^2~581 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a6032114473e2c84d3b5e9de914759366224e7b7;p=xonotic%2Fdarkplaces.git prevent crashes on BIH code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10965 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/model_brush.c b/model_brush.c index 4db0a503..a5c0c1ce 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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;