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:
parent
ad1563e5dc
commit
7f2a146597
1 changed files with 2 additions and 2 deletions
|
@ -518,12 +518,12 @@ static byte *find_unique_script_block(EngineState *s, byte *buf, int type) {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
int seeker_type = READ_LE_UINT16(buf);
|
int seeker_type = READ_LE_UINT16(buf);
|
||||||
int seeker_size;
|
|
||||||
|
|
||||||
if (seeker_type == 0) break;
|
if (seeker_type == 0) break;
|
||||||
if (seeker_type == type) return buf;
|
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;
|
buf += seeker_size;
|
||||||
} while(1);
|
} while(1);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue