[FFmpeg-devel] [PATCH 02/15] avcodec/truespeech: Fix invalid shift

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Sep 25 01:02:57 EEST 2019


Fixes the last undefined behaviour in the truespeech FATE-test as well
as the last of the truespeech bugs reported in ticket #8159. The other
left shifts of negative numbers have already been fixed in c7c0229b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/truespeech.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 54352851b3..bbbf75f06e 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -281,7 +281,7 @@ static void truespeech_synth(TSContext *dec, int16_t *out, int quart)
 
     ptr0 = dec->tmp3;
     for(i = 0; i < 60; i++){
-        int sum = out[i] << 12;
+        int sum = FFLSHIFT(out[i], 12);
         for(k = 0; k < 8; k++)
             sum += ptr0[k] * t[k];
         for(k = 7; k > 0; k--)
-- 
2.20.1



More information about the ffmpeg-devel mailing list