summaryrefslogtreecommitdiff
path: root/gst/audioresample
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-10 12:32:24 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-10 12:35:03 +0100
commitf588d14cdc75f23d8ca43fd978c20726152f4250 (patch)
tree7137f805c2be93e5aa4f5c49d451af780fe349ac /gst/audioresample
parent3d1fdf8dd84cac3c14f829a2e7d75bb12f5c52fa (diff)
audioresample: reject 0 denominator when creating resampler
Coverity 1195140, 1195139, 1195138
Diffstat (limited to 'gst/audioresample')
-rw-r--r--gst/audioresample/resample.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c
index 4410bdd9b..11171216d 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;