From 16b65badc06b60d434f5f7bb0781b324f567e18c Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 12 Jun 2015 01:06:19 +0200 Subject: SHERLOCK: 3DO: cel decoder change --- engines/sherlock/image_file.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/sherlock') diff --git a/engines/sherlock/image_file.cpp b/engines/sherlock/image_file.cpp index 3e11b09773..265be52253 100644 --- a/engines/sherlock/image_file.cpp +++ b/engines/sherlock/image_file.cpp @@ -348,6 +348,7 @@ static byte imagefile3DO_cel_bitsPerPixelLookupTable[8] = { // Reads a 3DO .cel/.anim file void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) { + int32 streamSize = stream.size(); int32 chunkStartPos = 0; uint32 chunkTag = 0; uint32 chunkSize = 0; @@ -379,7 +380,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) { memset(&plutRGBlookupTable, 0, sizeof(plutRGBlookupTable)); - while (!stream.err() && !stream.eos()) { + while (!stream.err() && (stream.pos() < streamSize)) { chunkStartPos = stream.pos(); chunkTag = stream.readUint32BE(); chunkSize = stream.readUint32BE(); -- cgit v1.2.3