(svn r19685) -Fix (r19679): off-by-one error

This commit is contained in:
yexo 2010-04-20 19:25:29 +00:00
parent 879057de25
commit ce8523f70a
1 changed files with 1 additions and 1 deletions

View File

@ -2082,7 +2082,7 @@ static ChangeInfoResult SoundEffectChangeInfo(uint sid, int numinfo, int prop, B
return CIR_INVALID_ID;
}
if (sid + numinfo - ORIGINAL_SAMPLE_COUNT >= _cur_grffile->num_sounds) {
if (sid + numinfo - ORIGINAL_SAMPLE_COUNT > _cur_grffile->num_sounds) {
grfmsg(1, "SoundEffectChangeInfo: Attemting to change undefined sound effect (%u), max (%u). Ignoring.", sid + numinfo, ORIGINAL_SAMPLE_COUNT + _cur_grffile->num_sounds);
return CIR_INVALID_ID;
}