mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
SCUMM: Fix OOB access in CharsetRendererPC::drawBits1Kor()
This commit is contained in:
@@ -785,10 +785,10 @@ void CharsetRendererPC::drawBits1Kor(Graphics::Surface &dest, int x1, int y1, co
|
||||
dst = origDst;
|
||||
|
||||
for (y = 0; y < height && y + drawTop + offsetY[i] < dest.h; y++) {
|
||||
for (x = 0; x < width && x + offsetY[i] < dest.w; x++) {
|
||||
for (x = 0; x < width && x + x1 + offsetX[i] < dest.w; x++) {
|
||||
if ((x % 8) == 0)
|
||||
bits = *src++;
|
||||
if ((bits & revBitMask(x % 8)) && y + drawTop >= 0) {
|
||||
if ((bits & revBitMask(x % 8)) && y + drawTop + offsetY[i] >= 0 && x + x1 + offsetX[i] >= 0) {
|
||||
if (_enableShadow) {
|
||||
*(dst + 1) = _shadowColor;
|
||||
*(dst + dest.pitch) = _shadowColor;
|
||||
|
||||
Reference in New Issue
Block a user