diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-17 16:32:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-17 18:00:25 +0200 |
commit | ad516dd271ff4557c441895ca8cb16a182c064e9 (patch) | |
tree | 227ea2f9292e97c6b3a18fc30b5dff77c192676f /libavcodec | |
parent | f46e87602700cfec7af62c36a0c6272a3a802106 (diff) | |
download | ffmpeg-ad516dd271ff4557c441895ca8cb16a182c064e9.tar.gz |
avcodec/resample2: Use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/resample2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/resample2.c b/libavcodec/resample2.c index 9b63b53c86..cd9fe1ce56 100644 --- a/libavcodec/resample2.c +++ b/libavcodec/resample2.c @@ -102,7 +102,7 @@ static double bessel(double x){ static int build_filter(FELEM *filter, double factor, int tap_count, int phase_count, int scale, int type){ int ph, i; double x, y, w; - double *tab = av_malloc(tap_count * sizeof(*tab)); + double *tab = av_malloc_array(tap_count, sizeof(*tab)); const int center= (tap_count-1)/2; if (!tab) @@ -202,7 +202,7 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, c->linear= linear; c->filter_length= FFMAX((int)ceil(filter_size/factor), 1); - c->filter_bank= av_mallocz(c->filter_length*(phase_count+1)*sizeof(FELEM)); + c->filter_bank= av_mallocz_array(c->filter_length, (phase_count+1)*sizeof(FELEM)); if (!c->filter_bank) goto error; if (build_filter(c->filter_bank, factor, c->filter_length, phase_count, 1<<FILTER_SHIFT, WINDOW_TYPE)) |