aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/image_file.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-02-04 18:47:08 -0500
committerPaul Gilbert2016-02-04 18:47:08 -0500
commit331a9f49690f59df207b437d36f5147a4e8dbf29 (patch)
tree0e6468232e7e14905dc19a577fc39e4772fb731f /engines/sherlock/image_file.cpp
parent72a3cae20b081c28f9b55b3d1440739d6aa2e4e1 (diff)
downloadscummvm-rg350-331a9f49690f59df207b437d36f5147a4e8dbf29.tar.gz
scummvm-rg350-331a9f49690f59df207b437d36f5147a4e8dbf29.tar.bz2
scummvm-rg350-331a9f49690f59df207b437d36f5147a4e8dbf29.zip
SHERLOCK: SS: Fix crash on invalid graphics in German version
Diffstat (limited to 'engines/sherlock/image_file.cpp')
-rw-r--r--engines/sherlock/image_file.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp
index 971980a2ac..1247a7f8d0 100644
--- a/engines/sherlock/image_file.cpp
+++ b/engines/sherlock/image_file.cpp
@@ -172,7 +172,7 @@ void ImageFrame::decompressFrame(const byte *src, bool isRoseTattoo) {
while (frameSize > 0) {
if (*src == _rleMarker) {
byte rleColor = src[1];
- byte rleCount = src[2];
+ byte rleCount = MIN((int)src[2], frameSize);
src += 3;
frameSize -= rleCount;
while (rleCount--)
@@ -182,7 +182,6 @@ void ImageFrame::decompressFrame(const byte *src, bool isRoseTattoo) {
--frameSize;
}
}
- assert(frameSize == 0);
} else {
// Uncompressed frame
Common::copy(src, src + _width * _height, dest);