aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorFilippos Karapetis2008-09-15 09:17:18 +0000
committerFilippos Karapetis2008-09-15 09:17:18 +0000
commit621847b2e2dd5907b8222933fb6eb6748aaf4777 (patch)
treee9afb5ae1851a5a0c44c67d5ed82ac88b52fc97a /engines/saga
parent1e3402fb0c0ffae30ff3f6725c1edc8f30c58f6f (diff)
downloadscummvm-rg350-621847b2e2dd5907b8222933fb6eb6748aaf4777.tar.gz
scummvm-rg350-621847b2e2dd5907b8222933fb6eb6748aaf4777.tar.bz2
scummvm-rg350-621847b2e2dd5907b8222933fb6eb6748aaf4777.zip
Proper check for eos(), after the latest changes to OSystem
svn-id: r34554
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/sprite.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index ee2e2b922f..a1f78e1b9f 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -412,6 +412,8 @@ void Sprite::decodeRLEBuffer(const byte *inputBuffer, size_t inLength, size_t ou
while (!readS.eos() && (outPointer < outPointerEnd)) {
bg_runcount = readS.readByte();
+ if (readS.eos())
+ break;
fg_runcount = readS.readByte();
for (c = 0; c < bg_runcount && !readS.eos(); c++) {
@@ -423,8 +425,9 @@ void Sprite::decodeRLEBuffer(const byte *inputBuffer, size_t inLength, size_t ou
}
for (c = 0; c < fg_runcount && !readS.eos(); c++) {
- // FIXME: eos changed; error handling?
*outPointer = readS.readByte();
+ if (readS.eos())
+ break;
if (outPointer < outPointerEnd)
outPointer++;
else