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
This commit is contained in:
Max Horn 2009-05-14 23:10:22 +00:00
parent ad1563e5dc
commit 7f2a146597

View file

@ -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);