diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-03 21:58:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-03 22:17:24 +0200 |
commit | e5aa6f702130f1afd53c61d058c2ebc48e61e9ea (patch) | |
tree | 84e29e12f05e4b40ab15689f0e6d7ad57a312ef2 /libavcodec/gsmdec_template.c | |
parent | 9ed53d5a8a9673e2178a4d6eb3a9fc12ebfbc323 (diff) | |
download | ffmpeg-e5aa6f702130f1afd53c61d058c2ebc48e61e9ea.tar.gz |
avcodec/gsmdec_template: avoid undefined negative left shifts
Fixes: unknown_unknown_338_824_cov_1045285351_sample-gsm-8000.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/gsmdec_template.c')
-rw-r--r-- | libavcodec/gsmdec_template.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/gsmdec_template.c b/libavcodec/gsmdec_template.c index 0c60813a4a..4cb777c854 100644 --- a/libavcodec/gsmdec_template.c +++ b/libavcodec/gsmdec_template.c @@ -64,7 +64,7 @@ static inline int decode_log_area(int coded, int factor, int offset) { coded <<= 10; coded -= offset; - return gsm_mult(coded, factor) << 1; + return gsm_mult(coded, factor) * 2; } static av_noinline int get_rrp(int filtered) @@ -121,7 +121,7 @@ static int postprocess(int16_t *data, int msr) int i; for (i = 0; i < 160; i++) { msr = av_clip_int16(data[i] + gsm_mult(msr, 28180)); - data[i] = av_clip_int16(msr << 1) & ~7; + data[i] = av_clip_int16(msr * 2) & ~7; } return msr; } |