[FFmpeg-cvslog] avcodec/clearvideo: Fix multiple runtime error: left shift of negative value -1024

Michael Niedermayer git at videolan.org
Sat May 6 13:41:37 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat May  6 12:17:01 2017 +0200| [c0ffcb34c7e94817be934a1ee4a0b4c054723549] | committer: Michael Niedermayer

avcodec/clearvideo: Fix multiple runtime error: left shift of negative value -1024

Fixes: 1360/clusterfuzz-testcase-minimized-5606472043986944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0ffcb34c7e94817be934a1ee4a0b4c054723549
---

 libavcodec/clearvideo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 437c459aa5..060affeafd 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -185,8 +185,8 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac,
     const int t3 = OP( 2408 * blk[5 * step] - 1609 * blk[3 * step]);    \
     const int t4 = OP( 1108 * blk[2 * step] - 2676 * blk[6 * step]);    \
     const int t5 = OP( 2676 * blk[2 * step] + 1108 * blk[6 * step]);    \
-    const int t6 = ((blk[0 * step] + blk[4 * step]) << dshift) + bias;  \
-    const int t7 = ((blk[0 * step] - blk[4 * step]) << dshift) + bias;  \
+    const int t6 = ((blk[0 * step] + blk[4 * step]) * (1 << dshift)) + bias;  \
+    const int t7 = ((blk[0 * step] - blk[4 * step]) * (1 << dshift)) + bias;  \
     const int t8 = t0 + t2;                                             \
     const int t9 = t0 - t2;                                             \
     const int tA = 181 * (t9 + (t1 - t3)) + 0x80 >> 8;                  \



More information about the ffmpeg-cvslog mailing list