From b884eac509fdad46627b14bfb67a0337c1e9e2dd Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 25 Mar 2011 21:11:04 +0000 Subject: [PATCH] prevent crashes on BIH code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10965 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=a6032114473e2c84d3b5e9de914759366224e7b7 --- model_brush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2