Browse Source

swr/ build_filter: use av_calloc() fix buffer overflow

Fixes integer & buffer overflow

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 12 years ago
parent
commit
f9abeecd94
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libswresample/resample.c

+ 1
- 1
libswresample/resample.c View File

@@ -235,7 +235,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
c->factor = factor;
c->filter_length = FFMAX((int)ceil(filter_size/factor), 1);
c->filter_alloc = FFALIGN(c->filter_length, 8);
c->filter_bank = av_mallocz(c->filter_alloc*(phase_count+1)*c->felem_size);
c->filter_bank = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size);
c->filter_type = filter_type;
c->kaiser_beta = kaiser_beta;
if (!c->filter_bank)


Loading…
Cancel
Save