aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/inter_playtoons.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index 05032d712c..584a9c6030 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -333,6 +333,13 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams &params) {
return false;
_vm->_draw->animateCursor(4);
+ if (offset > stream->size()) {
+ warning("oPlaytoons_readData: File \"%s\", Offset (%d) > file size (%d)",
+ file, offset, stream->size());
+ delete stream;
+ return false;
+ }
+
if (offset < 0)
stream->seek(offset + 1, SEEK_END);
else