From 97390c1ff49ec4c6bd144aa136d1d13d8ecb2931 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 19 Jul 2019 01:49:19 +0000 Subject: [PATCH] Fix another bunch of improperly sized bitmap arrays git-svn-id: https://svn.eduke32.com/eduke32@7806 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/build.cpp --- source/build/src/colmatch.cpp | 2 +- source/build/src/defs.cpp | 2 +- source/build/src/engine.cpp | 8 ++++---- source/build/src/engine_priv.h | 2 +- source/duke3d/src/premap.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/build/src/colmatch.cpp b/source/build/src/colmatch.cpp index f8693c6da..4ccdaf895 100644 --- a/source/build/src/colmatch.cpp +++ b/source/build/src/colmatch.cpp @@ -6,7 +6,7 @@ #define FASTPALRGBDIST (FASTPALCOLDEPTH*2+1) static int32_t rdist[FASTPALRGBDIST], gdist[FASTPALRGBDIST], bdist[FASTPALRGBDIST]; #define FASTPALGRIDSIZ (FASTPALCOLDEPTH>>FASTPALRIGHTSHIFT) -static char colhere[((FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2))>>3]; +static char colhere[((FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)+7)>>3]; static char colhead[(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)]; static int32_t colnext[256]; #define FASTPALCOLDIST (1<>3]; + uint8_t usedframebitmap[(1024+7)>>3]; int32_t model_ok = 1; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 7ee998efb..9741651fa 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -516,10 +516,10 @@ void yax_update(int32_t resetstat) { // make bunchnums consecutive uint8_t *const havebunch = (uint8_t *)tempbuf; - uint8_t *const bunchmap = havebunch + (YAX_MAXBUNCHES>>3); + uint8_t *const bunchmap = havebunch + ((YAX_MAXBUNCHES+7)>>3); int32_t dasub = 0; - Bmemset(havebunch, 0, YAX_MAXBUNCHES>>3); + Bmemset(havebunch, 0, (YAX_MAXBUNCHES+7)>>3); for (i=0; i>3]; +uint8_t haveymost[(YAX_MAXBUNCHES+7)>>3]; static inline int32_t yax_walldist(int32_t w) { @@ -864,7 +864,7 @@ void yax_preparedrawrooms(void) void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), int16_t sectnum, int32_t didmirror, int32_t smoothr) { - static uint8_t havebunch[YAX_MAXBUNCHES>>3]; + static uint8_t havebunch[(YAX_MAXBUNCHES+7)>>3]; const fix16_t horiz = global100horiz; diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index 3a1470354..0fb6ea564 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -305,7 +305,7 @@ int32_t renderAddTsprite(int16_t z, int16_t sectnum); extern int32_t g_nodraw, scansector_retfast, scansector_collectsprites; extern int32_t yax_globallev, yax_globalbunch; extern int32_t yax_globalcf, yax_nomaskpass, yax_nomaskdidit; -extern uint8_t haveymost[YAX_MAXBUNCHES>>3]; +extern uint8_t haveymost[(YAX_MAXBUNCHES+7)>>3]; extern uint8_t yax_gotsector[(MAXSECTORS+7)>>3]; extern int32_t yax_polymostclearzbuffer; diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index fe38af71b..13fd25be1 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # include "lunatic_game.h" #endif -static uint8_t precachehightile[2][MAXTILES>>3]; +static uint8_t precachehightile[2][(MAXTILES+7)>>3]; static int32_t g_precacheCount;