Skip to content

Commit

Permalink
AURORA: Throw if shared string index in GFF4 is out of range
Browse files Browse the repository at this point in the history
Instead of using assert().
  • Loading branch information
DrMcCoy committed Nov 11, 2016
1 parent a8c9454 commit 68ac0d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aurora/gff4file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ Common::UString GFF4File::getSharedString(uint32 i) const {
if (i == 0xFFFFFFFF)
return "";

assert(i < _sharedStrings.size());
if (i >= _sharedStrings.size())
throw Common::Exception("GFF4: Shared string index out of range (%u >= %u)",
i, (uint) _sharedStrings.size());

return _sharedStrings[i];
}
Expand Down

0 comments on commit 68ac0d7

Please sign in to comment.