diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-06 17:32:56 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-06 17:33:31 +0300 |
commit | 4ace2d22192f3995911ec926940125dcb29d606a (patch) | |
tree | 40f295f22e1b850da4dd65d5daa98d44861ff5f5 /libavcodec/g723_1dec.c | |
parent | fc2c420b82939a8f30838a6aa08bfd936099d3ce (diff) |
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>
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 e9896b5e7a..0b9fd39946 100644 --- a/libavcodec/g723_1dec.c +++ b/libavcodec/g723_1dec.c @@ -517,7 +517,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;\ }\ } @@ -904,7 +904,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; |