Skip to content

Commit

Permalink
SWORD1: Avoid possible division by zero in speech endianness heuristic
Browse files Browse the repository at this point in the history
  • Loading branch information
criezy committed Sep 10, 2014
1 parent 4eb8b28 commit 4aaa74a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/sword1/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ double Sound::endiannessHeuristicValue(int16* data, uint32 dataSize, uint32 &max
prev_value = value;
}
}
if (cpt == 0)
return 50000.;
maxSamples = cpt;
return diff_sum / cpt;
}
Expand Down

0 comments on commit 4aaa74a

Please sign in to comment.