History

swr/ build_filter: use av_calloc() fix buffer overflow

Fixes integer & buffer overflow

Michael Niedermayer committed 13 years ago

Commit f9abeec1 parent 167af701 file · +1 −1Browse files

Showing the changes to libswresample (1 of 1 file). Show all

Unified · Split

libswresample/resample.c+1−1
@@ -235,7 +235,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r · 234 unmodified lines
235235 c->factor = factor;
236236 c->filter_length = FFMAX((int)ceil(filter_size/factor), 1);
237237 c->filter_alloc = FFALIGN(c->filter_length, 8);
238− c->filter_bank = av_mallocz(c->filter_alloc*(phase_count+1)*c->felem_size);
238+ c->filter_bank = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size);
239239 c->filter_type = filter_type;
240240 c->kaiser_beta = kaiser_beta;
241241 if (!c->filter_bank)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t