aboutsummaryrefslogtreecommitdiff
path: root/engines/director/images.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-31 16:37:51 +0100
committerEugene Sandulenko2019-12-31 16:37:51 +0100
commit42dc7451adb979229588784a22560b92342b4d59 (patch)
treee2ce581f5258288d7ebf34a317ad5eb549891bdf /engines/director/images.cpp
parenta85989dd8a0b130f4a0be44c90e6488cb60caf4f (diff)
downloadscummvm-rg350-42dc7451adb979229588784a22560b92342b4d59.tar.gz
scummvm-rg350-42dc7451adb979229588784a22560b92342b4d59.tar.bz2
scummvm-rg350-42dc7451adb979229588784a22560b92342b4d59.zip
DIRECTOR: Fix out-of-bounds write
Diffstat (limited to 'engines/director/images.cpp')
-rw-r--r--engines/director/images.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index 4f2ffc9dc0..3d031c7518 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -204,7 +204,7 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
for (x = 0; x < _surface->w;) {
switch (_bitsPerPixel) {
case 1: {
- for (int c = 0; c < 8; c++, x++) {
+ for (int c = 0; c < 8 && x < _surface->w; c++, x++) {
*((byte *)_surface->getBasePtr(x, y)) = (pixels[(((y * _surface->pitch) + x) / 8)] & (1 << (7 - c))) ? 0 : 0xff;
}
break;