Skip to content

Commit

Permalink
[Endings] Fix extra font array sizes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nmlgc committed Sep 3, 2022
1 parent 5b0e190 commit 5c163b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GIAN07/ENDING.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ EndingStTask EStfTask;
EndingText EText;

// フォント情報格納用ね //
ExtraFontInfo *pFontInfo[6];
ExtraFontInfo *pFontInfo[7];
ExtraFontInfo *pMember[7];

// フラッシュの状態 //
Expand Down Expand Up @@ -143,7 +143,7 @@ FVOID EndingCleanup()
{
int i;

for(i=0; i<6; i++){
for(i=0; i<7; i++){
DeleteExtraFont(pFontInfo[i]);
}

Expand Down

0 comments on commit 5c163b6

Please sign in to comment.