aboutsummaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorPaul Gilbert2016-10-26 22:16:23 -0400
committerPaul Gilbert2016-10-26 22:16:23 -0400
commit7564d47e993584bb62fd4cf1f4638d15785fb4d4 (patch)
tree5fcc9ea3104d46cb8d986300f112f3cb63801869 /image
parent73725bab07dc8b1cdd73577e47d5406f72f5d9ba (diff)
downloadscummvm-rg350-7564d47e993584bb62fd4cf1f4638d15785fb4d4.tar.gz
scummvm-rg350-7564d47e993584bb62fd4cf1f4638d15785fb4d4.tar.bz2
scummvm-rg350-7564d47e993584bb62fd4cf1f4638d15785fb4d4.zip
IMAGE: Fix incorrect warnings decoding MSRLE images
Diffstat (limited to 'image')
-rw-r--r--image/codecs/msrle.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/image/codecs/msrle.cpp b/image/codecs/msrle.cpp
index bb1125e0af..95cada7e75 100644
--- a/image/codecs/msrle.cpp
+++ b/image/codecs/msrle.cpp
@@ -72,15 +72,10 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
y--;
output = data + (y * width);
- if (y < 0) {
- warning("MS RLE Codec: Next line is beyond picture bounds");
- return;
- }
-
} else if (value == 1) {
// End of image
-
return;
+
} else if (value == 2) {
// Skip
@@ -99,6 +94,10 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
} else {
// Copy data
+ if (y < 0) {
+ warning("MS RLE Codec: Copy data is beyond picture bounds");
+ return;
+ }
if (output + value > output_end) {
if (stream.pos() + value >= stream.size())
@@ -119,6 +118,10 @@ void MSRLEDecoder::decode8(Common::SeekableReadStream &stream) {
} else {
// Run data
+ if (y < 0) {
+ warning("MS RLE Codec: Run data is beyond picture bounds");
+ return;
+ }
if (output + count > output_end)
continue;