From 4aaa74aea7b678d736c70d380a29987c2e003ca6 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 10 Sep 2014 20:25:51 +0100 Subject: SWORD1: Avoid possible division by zero in speech endianness heuristic --- engines/sword1/sound.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; } -- cgit v1.2.3