diff --git a/libswresample/resample.c b/libswresample/resample.c index 036eff391f..c881ed8f41 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -74,7 +74,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap int filter_type, int kaiser_beta){ int ph, i; double x, y, w; - double *tab = av_malloc_array(tap_count, sizeof(*tab)); + double *tab = av_malloc_array(tap_count+1, sizeof(*tab)); const int center= (tap_count-1)/2; if (!tab) @@ -84,9 +84,10 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap if (factor > 1.0) factor = 1.0; - for(ph=0;ph