diff options
author | Sven Hesse | 2011-01-18 04:19:33 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-18 04:19:33 +0000 |
commit | 283bec822d4c0a8e812e46aa824b8ea0b4d7227b (patch) | |
tree | 918fe58a111afc35e8ee155e9859a00ffd376e2c | |
parent | 92ddccec091cf837ebcd680fee91c570f8b0eed8 (diff) | |
download | scummvm-rg350-283bec822d4c0a8e812e46aa824b8ea0b4d7227b.tar.gz scummvm-rg350-283bec822d4c0a8e812e46aa824b8ea0b4d7227b.tar.bz2 scummvm-rg350-283bec822d4c0a8e812e46aa824b8ea0b4d7227b.zip |
GOB: Add a sanity check in oPlaytoons_readData
svn-id: r55284
-rw-r--r-- | engines/gob/inter_playtoons.cpp | 7 |
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 ¶ms) { 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 |