DIRECTOR: Do not crash on unhandled casts

This commit is contained in:
Eugene Sandulenko 2019-12-30 22:53:16 +01:00
parent 4a4819d7df
commit 825122f494

View File

@ -722,8 +722,9 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
break;
}
for (uint child = 0; child < res->children.size(); child++)
_loadedCast->getVal(id)->_children.push_back(res->children[child]);
if (_loadedCast->contains(id)) // Skip unhandled casts
for (uint child = 0; child < res->children.size(); child++)
_loadedCast->getVal(id)->_children.push_back(res->children[child]);
free(data);