diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-25 10:34:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-25 10:34:06 +0200 |
commit | 7e592379d909e5df2382b0aab92d51d98dafe578 (patch) | |
tree | 4a2fd26ec73ec9de709f60486e138c8fc06a2fcd /libswresample/resample.c | |
parent | 8b11ae8a9a3c88dee475477a0c6fcd17c970efcc (diff) |
resample: Fix boundary handling with fragments.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/resample.c')
-rw-r--r-- | libswresample/resample.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c index 2960a35745..d3c5cfa62c 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -294,11 +294,11 @@ int swri_resample(ResampleContext *c, int16_t *dst, const int16_t *src, int *con int sample_index= index >> c->phase_shift; FELEM2 val=0; - if(sample_index < 0){ - for(i=0; i<c->filter_length; i++) - val += src[FFABS(sample_index + i) % src_size] * filter[i]; - }else if(sample_index + c->filter_length > src_size){ + if(sample_index + c->filter_length > src_size || -sample_index >= src_size){ break; + }else if(sample_index < 0){ + for(i=0; i<c->filter_length; i++) + val += src[FFABS(sample_index + i)] * filter[i]; }else if(c->linear){ FELEM2 v2=0; for(i=0; i<c->filter_length; i++){ |