Commit e5aa6f70 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9ed53d5a
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment