mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 05:01:43 +00:00
SCUMM: fix possible invalid access
(won't happen, but PVS studio wants this)
This commit is contained in:
parent
6848116b9c
commit
aeb1003d5e
@ -310,7 +310,9 @@ void TextRenderer_v7::drawStringWrap(const char *str, byte *buffer, Common::Rect
|
||||
substrWidths[numSubstrings] = curWidth;
|
||||
substrByteLength[numSubstrings] = curPos - substrStart[numSubstrings];
|
||||
numSubstrings++;
|
||||
substrStart[numSubstrings] = curPos + 1;
|
||||
// extra check for PVS-Studio (we won't actually ever get close to SCUMM7_MAX_STRINGS)
|
||||
if (numSubstrings < SCUMM7_MAX_STRINGS)
|
||||
substrStart[numSubstrings] = curPos + 1;
|
||||
}
|
||||
curWidth = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user