diff options
author | Thierry Crozat | 2014-09-10 20:25:51 +0100 |
---|---|---|
committer | Thierry Crozat | 2014-09-10 20:25:51 +0100 |
commit | 4aaa74aea7b678d736c70d380a29987c2e003ca6 (patch) | |
tree | a231156930d906ffbfee00ddcf6d3c28b51774a4 /engines | |
parent | 4eb8b2898679856d66adb3faaf6e55c217433edf (diff) | |
download | scummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.tar.gz scummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.tar.bz2 scummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.zip |
SWORD1: Avoid possible division by zero in speech endianness heuristic
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword1/sound.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index 37f92fc0b2..9140bddb65 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -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; } |