[FFmpeg-devel] [PATCH 1/2] qdm2: Fix data type used in multiplication.

Michael Niedermayer michaelni at gmx.at
Sun Dec 30 03:32:05 CET 2012


Avoid unintended truncation.
Fixes CID700555

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/qdm2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index c8727c6..e6e24d9 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -685,7 +685,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
                     for (j = 0; j < 64; j++)
                         acc += tone_level_idx_temp[ch][sb][j];
 
-            multres = 0x66666667 * (acc * 10);
+            multres = 0x66666667LL * (acc * 10);
             esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
             for (ch = 0;  ch < nb_channels; ch++)
                 for (sb = 0; sb < 30; sb++)
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list