[FFmpeg-cvslog] swr/ build_filter: use av_calloc() fix buffer overflow
Michael Niedermayer
git at videolan.org
Sun Jan 27 06:16:31 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 27 05:57:58 2013 +0100| [f9abeecd94cfa335bf43e2a19b60fb990a46644f] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f9abeecd94cfa335bf43e2a19b60fb990a46644f
---
libswresample/resample.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 6cd2b8c..d3fe1a7 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -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)
More information about the ffmpeg-cvslog
mailing list