aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);