aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--image/bmp.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/image/bmp.cpp b/image/bmp.cpp
index cdf6e4097d..28eb049035 100644
--- a/image/bmp.cpp
+++ b/image/bmp.cpp
@@ -119,6 +119,10 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
if (!_codec)
return false;
+ // If the image size is zero, set it to the rest of the stream.
+ if (imageSize == 0)
+ imageSize = stream.size() - imageOffset;
+
// Grab the frame data
Common::SeekableSubReadStream subStream(&stream, imageOffset, imageOffset + imageSize);