Commit e16592c4 authored by Michael Niedermayer's avatar Michael Niedermayer

swresample/resample: Fix undefined shifts

Found-by: Clang -fsanitize=shift
Reported-by: 's avatarThierry Foucu <tfoucu@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b14de8e6
...@@ -338,7 +338,7 @@ static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, A ...@@ -338,7 +338,7 @@ static int multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, A
static int64_t get_delay(struct SwrContext *s, int64_t base){ static int64_t get_delay(struct SwrContext *s, int64_t base){
ResampleContext *c = s->resample; ResampleContext *c = s->resample;
int64_t num = s->in_buffer_count - (c->filter_length-1)/2; int64_t num = s->in_buffer_count - (c->filter_length-1)/2;
num <<= c->phase_shift; num *= 1 << c->phase_shift;
num -= c->index; num -= c->index;
num *= c->src_incr; num *= c->src_incr;
num -= c->frac; num -= c->frac;
......
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