diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-06 16:32:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-16 16:00:22 +0200 |
commit | 677c9f27cc60278c3b7b74b211eda547c56d941c (patch) | |
tree | 0796be04e2d2b797fe786cd585fe9a7e9a7b7db0 /libavcodec/g723_1dec.c | |
parent | 9f7bc8296bddfa68a375b45905e641cfe40fd048 (diff) | |
download | ffmpeg-677c9f27cc60278c3b7b74b211eda547c56d941c.tar.gz |
avcodec/g723_1: Fix multiple runtime error: left shift of negative value
Fixes: 1367/clusterfuzz-testcase-minimized-571496882346393
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 4ace2d22192f3995911ec926940125dcb29d606a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/g723_1dec.c')
-rw-r--r-- | libavcodec/g723_1dec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c index 6f283b449f..3454ed6074 100644 --- a/libavcodec/g723_1dec.c +++ b/libavcodec/g723_1dec.c @@ -516,7 +516,7 @@ static void residual_interp(int16_t *buf, int16_t *out, int lag, (iir_coef)[n - 1] * ((dest)[m - n] >> in_shift);\ }\ \ - (dest)[m] = av_clipl_int32(((src)[m] << 16) + (filter << 3) +\ + (dest)[m] = av_clipl_int32(((src)[m] * 65536) + (filter * 8) +\ (1 << 15)) >> res_shift;\ }\ } @@ -903,7 +903,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data, &p->subframe[i], p->cur_rate); /* Get the total excitation */ for (j = 0; j < SUBFRAME_LEN; j++) { - int v = av_clip_int16(vector_ptr[j] << 1); + int v = av_clip_int16(vector_ptr[j] * 2); vector_ptr[j] = av_clip_int16(v + acb_vector[j]); } vector_ptr += SUBFRAME_LEN; |