From c8eeae8d4dffa5849a23cf963884027a7789504b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 14 Sep 2008 22:28:53 +0000 Subject: Big patch changing semantics of ReadStream::eos(): eos() now only returns true _after_ trying to read past the end of the stream. This has a large potential for regressions. Please test! svn-id: r34549 --- graphics/iff.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'graphics') diff --git a/graphics/iff.cpp b/graphics/iff.cpp index 514fba9cc0..b3846c5d26 100644 --- a/graphics/iff.cpp +++ b/graphics/iff.cpp @@ -219,7 +219,7 @@ void PBMDecoder::readBODY(Common::IFFChunk& chunk) { switch (_bitmapHeader.pack) { case 0: - while (!chunk.eos()) { + while (!chunk.hasReadAll()) { ((byte*)_surface->pixels)[si++] = chunk.readByte(); } break; @@ -245,7 +245,9 @@ PackBitsReadStream::~PackBitsReadStream() { } bool PackBitsReadStream::eos() const { - return _input->eos() & (_rStoragePos == _wStoragePos); + //FIXME: eos definition needs to be changed in parallaction engine + // which is the only place where this class is used + return _input->eos() && (_rStoragePos == _wStoragePos); } uint32 PackBitsReadStream::read(void *dataPtr, uint32 dataSize) { @@ -291,6 +293,9 @@ void PackBitsReadStream::unpack() { while (_out < _outEnd && !_input->eos()) { byteRun = _input->readByte(); + //FIXME: eos definition needs to be changed in parallaction engine + // which is the only place where this class is used + //if (_input->eos()) break; if (byteRun <= 127) { i = byteRun + 1; for (j = 0; j < i; j++) { -- cgit v1.2.3