From f588d14cdc75f23d8ca43fd978c20726152f4250 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 10 Apr 2014 12:32:24 +0100 Subject: [PATCH] audioresample: reject 0 denominator when creating resampler Coverity 1195140, 1195139, 1195138 --- gst/audioresample/resample.c | 5 +++++ 1 file changed, 5 insertions(+) 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;