aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-04 12:27:10 +0100
committerAlyssa Milburn2011-11-04 12:27:10 +0100
commit5b7d2cd65a90a9ac5851a7bad6976d063f700ef1 (patch)
tree2b0ec7a9bbdd4c2d382bf03cc2b390a5dccfa2a8
parentbee2e69e117af5205e96083cb7b0b128dd891e0c (diff)
downloadscummvm-rg350-5b7d2cd65a90a9ac5851a7bad6976d063f700ef1.tar.gz
scummvm-rg350-5b7d2cd65a90a9ac5851a7bad6976d063f700ef1.tar.bz2
scummvm-rg350-5b7d2cd65a90a9ac5851a7bad6976d063f700ef1.zip
COMPOSER: Improve check for invalid CTBLs.
-rw-r--r--engines/composer/graphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index f253d85ad7..ced7073f10 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -499,8 +499,8 @@ void ComposerEngine::loadCTBL(uint16 id, uint fadePercent) {
uint16 numEntries = stream->readUint16LE();
debug(1, "CTBL: %d entries", numEntries);
- assert(numEntries <= 256);
- assert(stream->size() == 2 + (numEntries * 3));
+ if ((numEntries > 256) || (stream->size() < 2 + (numEntries * 3)))
+ error("CTBL %d was invalid (%d entries, size %d)", id, numEntries, stream->size());
byte buffer[256 * 3];
stream->read(buffer, numEntries * 3);