aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-08-16 10:36:55 +0200
committerEugene Sandulenko2019-09-03 17:17:34 +0200
commitf0eb59cdee3f8ac0152b6075f68db6d6a9784f85 (patch)
treeee91b22baa149a9b77982222259f4c2f84157293 /engines
parente1f05066426622f2ff42782e229209e2c368d53d (diff)
downloadscummvm-rg350-f0eb59cdee3f8ac0152b6075f68db6d6a9784f85.tar.gz
scummvm-rg350-f0eb59cdee3f8ac0152b6075f68db6d6a9784f85.tar.bz2
scummvm-rg350-f0eb59cdee3f8ac0152b6075f68db6d6a9784f85.zip
HDB: Draw all stars/snow in PPC version.
Along the way, this caught a buffer overflow, so sanity checks were also implemented
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/gfx.cpp4
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) {