提交 ad516dd2 编写于 作者: M Michael Niedermayer

avcodec/resample2: Use av_malloc(z)_array()

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 f46e8760
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册