diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c index 4410bdd9b8..11171216d7 100644 --- a/gst/audioresample/resample.c +++ b/gst/audioresample/resample.c @@ -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;