[FFmpeg-cvslog] avfilter/af_aphaser: reject too small delay

Paul B Mahol git at videolan.org
Tue May 12 14:09:49 CEST 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 12 12:02:49 2015 +0000| [94e293a83cd7e6b7fa9f3fcd90e9ddae4c274c73] | committer: Paul B Mahol

avfilter/af_aphaser: reject too small delay

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=94e293a83cd7e6b7fa9f3fcd90e9ddae4c274c73
---

 libavfilter/af_aphaser.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/af_aphaser.c b/libavfilter/af_aphaser.c
index b08570f..582f6e7 100644
--- a/libavfilter/af_aphaser.c
+++ b/libavfilter/af_aphaser.c
@@ -206,6 +206,10 @@ static int config_output(AVFilterLink *outlink)
     AVFilterLink *inlink = outlink->src->inputs[0];
 
     p->delay_buffer_length = p->delay * 0.001 * inlink->sample_rate + 0.5;
+    if (p->delay_buffer_length <= 0) {
+        av_log(outlink->src, AV_LOG_ERROR, "delay is too small\n");
+        return AVERROR(EINVAL);
+    }
     p->delay_buffer = av_calloc(p->delay_buffer_length, sizeof(*p->delay_buffer) * inlink->channels);
     p->modulation_buffer_length = inlink->sample_rate / p->speed + 0.5;
     p->modulation_buffer = av_malloc_array(p->modulation_buffer_length, sizeof(*p->modulation_buffer));



More information about the ffmpeg-cvslog mailing list