all repos — mgba @ bbcf161fec2d6bb860fd75fd9b9012457ce8e6c4

mGBA Game Boy Advance Emulator

Fix warning about exceeding bounds of array
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Oct 2014 15:49:45 -0700
commit

bbcf161fec2d6bb860fd75fd9b9012457ce8e6c4

parent

2bca4c399bda1e630b23ac6cefc56dfb588774e2

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -365,7 +365,7 @@ softwareRenderer->windows[activeWindow].control = win->control;

softwareRenderer->windows[activeWindow].endX = win->h.end; if (win->h.end >= oldWindow.endX) { // Trim off extra windows we've overwritten - for (++activeWindow; win->h.end >= softwareRenderer->windows[activeWindow].endX && softwareRenderer->nWindows > activeWindow; ++activeWindow) { + for (++activeWindow; softwareRenderer->nWindows > activeWindow + 1 && win->h.end >= softwareRenderer->windows[activeWindow].endX; ++activeWindow) { softwareRenderer->windows[activeWindow] = softwareRenderer->windows[activeWindow + 1]; --softwareRenderer->nWindows; }