aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-06 12:10:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commitce0db291c63a8678ad3144f029c05790065e1d80 (patch)
tree2df6e8c478dee3da82eca35d103d7a2952eb4a3a /libavcodec
parent00371aff3dcbc7f2e1d3d05ded745876a95c00da (diff)
downloadffmpeg-ce0db291c63a8678ad3144f029c05790065e1d80.tar.gz
avcodec/fic: Fix multiple left shift of negative value -15
Fixes: 1356/clusterfuzz-testcase-minimized-6008489086287872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b20c71409b24460983ba5d9afa0716714f9e0f7d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/fic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index b58b017c77..120188ccd0 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -94,8 +94,8 @@ static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd
const int t7 = t3 - t1;
const int t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
const int t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
- const int tA = (blk[0 * step] - blk[4 * step] << 15) + rnd;
- const int tB = (blk[0 * step] + blk[4 * step] << 15) + rnd;
+ const int tA = (blk[0 * step] - blk[4 * step]) * 32768 + rnd;
+ const int tB = (blk[0 * step] + blk[4 * step]) * 32768 + rnd;
blk[0 * step] = ( t4 + t9 + tB) >> shift;
blk[1 * step] = ( t6 + t7 + t8 + tA) >> shift;
blk[2 * step] = ( t6 - t7 - t8 + tA) >> shift;