diff options
Diffstat (limited to 'engines/bladerunner/bladerunner.cpp')
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index e4049830d7..93ffbe0e5e 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -2232,8 +2232,8 @@ Graphics::Surface BladeRunnerEngine::generateThumbnail() const { for (int x = 0; x < thumbnail.w; ++x) { uint8 r, g, b; - uint16 srcPixel = *(const uint16 *)_surfaceFront.getBasePtr(x * 8, y * 8); - uint16 *dstPixel = (uint16 *)thumbnail.getBasePtr(x, y); + uint16 srcPixel = *(const uint16 *)_surfaceFront.getBasePtr(CLIP(x * 8, 0, _surfaceFront.w - 1), CLIP(y * 8, 0, _surfaceFront.h - 1) ); + uint16 *dstPixel = (uint16 *)thumbnail.getBasePtr(CLIP(x, 0, thumbnail.w - 1), CLIP(y, 0, thumbnail.h - 1)); // Throw away alpha channel as it is not needed _surfaceFront.format.colorToRGB(srcPixel, r, g, b); |