audioresample: reject 0 denominator when creating resampler

Coverity 1195140, 1195139, 1195138
This commit is contained in:
Vincent Penquerc'h 2014-04-10 12:32:24 +01:00
parent 3d1fdf8dd8
commit f588d14cdc

View file

@ -988,6 +988,11 @@ speex_resampler_init_frac (spx_uint32_t nb_channels, spx_uint32_t ratio_num,
*err = RESAMPLER_ERR_INVALID_ARG;
return NULL;
}
if (ratio_den == 0) {
if (err)
*err = RESAMPLER_ERR_INVALID_ARG;
return NULL;
}
switch (sinc_filter_mode) {
case RESAMPLER_SINC_FILTER_INTERPOLATED:
use_full_sinc_table = 0;