Fixes integer & buffer overflow
Showing the changes to libswresample (1 of 1 file). Show all
Unified · Split
| @@ -235,7 +235,7 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r · 234 unmodified lines | |||
| 235 | c->factor = factor; | 235 | c->factor = factor; |
| 236 | c->filter_length = FFMAX((int)ceil(filter_size/factor), 1); | 236 | c->filter_length = FFMAX((int)ceil(filter_size/factor), 1); |
| 237 | c->filter_alloc = FFALIGN(c->filter_length, 8); | 237 | 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); |
| 239 | c->filter_type = filter_type; | 239 | c->filter_type = filter_type; |
| 240 | c->kaiser_beta = kaiser_beta; | 240 | c->kaiser_beta = kaiser_beta; |
| 241 | if (!c->filter_bank) | 241 | if (!c->filter_bank) |