diff options
-rw-r--r-- | engines/hdb/gfx.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 4ebb052705..5d8f5cae4c 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -522,7 +522,11 @@ Tile *Gfx::loadIcon(const char *tileName) { } void Gfx::setPixel(int x, int y, uint16 color) { + if (x < 0 || y < 0 || x >= _globalSurface.w || y >= _globalSurface.h) + return; + *(uint16 *)_globalSurface.getBasePtr(x, y) = color; + g_system->copyRectToScreen(_globalSurface.getBasePtr(x, y), _globalSurface.pitch, x, y, 1, 1); } Tile *Gfx::getTile(int index) { |