diff options
author | Max Horn | 2009-05-14 23:10:22 +0000 |
---|---|---|
committer | Max Horn | 2009-05-14 23:10:22 +0000 |
commit | 7f2a1465970a842a6345a790610aadb0cb75e0fe (patch) | |
tree | b6691df020b207b904a9b59687131e3d908a4fdf /engines | |
parent | ad1563e5dc06f1120958506eaabde705aaa46e34 (diff) | |
download | scummvm-rg350-7f2a1465970a842a6345a790610aadb0cb75e0fe.tar.gz scummvm-rg350-7f2a1465970a842a6345a790610aadb0cb75e0fe.tar.bz2 scummvm-rg350-7f2a1465970a842a6345a790610aadb0cb75e0fe.zip |
SCI: Added a paranoia check to find_unique_script_block which causes us to bail out if we are about to get stuck in an endless loop
svn-id: r40580
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 9fc2c98320..c916aa0b4e 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -518,12 +518,12 @@ static byte *find_unique_script_block(EngineState *s, byte *buf, int type) { do { int seeker_type = READ_LE_UINT16(buf); - int seeker_size; if (seeker_type == 0) break; if (seeker_type == type) return buf; - seeker_size = READ_LE_UINT16(buf + 2); + int seeker_size = READ_LE_UINT16(buf + 2); + assert(seeker_size > 0); buf += seeker_size; } while(1); |