aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2014-09-10 20:25:51 +0100
committerThierry Crozat2014-09-10 20:25:51 +0100
commit4aaa74aea7b678d736c70d380a29987c2e003ca6 (patch)
treea231156930d906ffbfee00ddcf6d3c28b51774a4
parent4eb8b2898679856d66adb3faaf6e55c217433edf (diff)
downloadscummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.tar.gz
scummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.tar.bz2
scummvm-rg350-4aaa74aea7b678d736c70d380a29987c2e003ca6.zip
SWORD1: Avoid possible division by zero in speech endianness heuristic
-rw-r--r--engines/sword1/sound.cpp2
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;
}