From 5c163b6adf746289bf80e449752da888cea09a97 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Wed, 31 Aug 2022 06:07:25 +0200 Subject: [PATCH] [Endings] Fix extra font array sizes These errors actually cause the game to crash in optimized Visual Studio 2022 Release builds. Of all variables it could have placed after `pFontInfo`, it chose `EnemyNow`, whose corruption caused enemy_move() to parse an unallocated ECL buffer. Really shows how theoretical bugs like these can turn into actual bugs just by updating your compiler. Who knows how many more of these are lurking in this codebase? Completes P0217, funded by Arandui. --- GIAN07/ENDING.CPP | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GIAN07/ENDING.CPP b/GIAN07/ENDING.CPP index 81ed6b20..b469354c 100644 --- a/GIAN07/ENDING.CPP +++ b/GIAN07/ENDING.CPP @@ -45,7 +45,7 @@ EndingStTask EStfTask; EndingText EText; // フォント情報格納用ね // -ExtraFontInfo *pFontInfo[6]; +ExtraFontInfo *pFontInfo[7]; ExtraFontInfo *pMember[7]; // フラッシュの状態 // @@ -143,7 +143,7 @@ FVOID EndingCleanup() { int i; - for(i=0; i<6; i++){ + for(i=0; i<7; i++){ DeleteExtraFont(pFontInfo[i]); }