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

Submitted by Andreas Rheinhardt on Sept. 24, 2019, 10:02 p.m.

Details

Message ID 20190924220310.31157-3-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt Sept. 24, 2019, 10:02 p.m.
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@gmail.com>
---
 libavcodec/truespeech.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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--)