Skip to content

Commit

Permalink
Add out-of-range guard to plotChar+ functions (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
flend authored Dec 21, 2023
1 parent 83a1ffc commit 0572e07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/brogue/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,9 @@ void plotCharWithColor(enum displayGlyph inputChar, windowpos loc, const color *
foreRand, backRand;

brogueAssert(locIsInWindow(loc));
if (!locIsInWindow(loc)) {
return;
}

if (rogue.gameHasEnded || rogue.playbackFastForward) {
return;
Expand Down Expand Up @@ -1828,6 +1831,9 @@ void plotCharToBuffer(enum displayGlyph inputChar, windowpos loc, const color *f
}

brogueAssert(locIsInWindow(loc));
if (!locIsInWindow(loc)) {
return;
}

oldRNG = rogue.RNG;
rogue.RNG = RNG_COSMETIC;
Expand Down

0 comments on commit 0572e07

Please sign in to comment.