SCUMM: (GUI) - fix invalid mem access

This commit is contained in:
athrxx
2022-08-31 22:47:06 +02:00
parent 6cb7d2c96c
commit 7932cf7a46
+3 -3
View File
@@ -1659,11 +1659,11 @@ void ScummEngine::drawLine(int x1, int y1, int x2, int y2, int color) {
void ScummEngine::drawPixel(VirtScreen *vs, int x, int y, int16 color, bool useBackbuffer) {
if (x >= 0 && y >= 0 && _screenWidth + 8 > x && _screenHeight > y) {
if (useBackbuffer)
memset(vs->getBackPixels(x, y + _screenTop), color, 1);
vs->setPixel(x, y + _screenTop - vs->topline, color);
else
memset(vs->getPixels(x, y + _screenTop), color, 1);
vs->setPixel(x, y + _screenTop - vs->topline, color);
markRectAsDirty(vs->number, x, x + 1, y + _screenTop, y + 1 + _screenTop);
markRectAsDirty(vs->number, x, x + 1, y + _screenTop - vs->topline, y + 1 + _screenTop - vs->topline);
}
}