[FFmpeg-cvslog] avfilter/af_silenceremove: fix possible crash if supplied duration is negative

Paul B Mahol git at videolan.org
Mon Nov 27 17:34:17 EET 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Nov 27 16:32:54 2017 +0100| [2d1594a8d6a754a426cb53184dccf9cf8c8a94b0] | committer: Paul B Mahol

avfilter/af_silenceremove: fix possible crash if supplied duration is negative

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

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

 libavfilter/af_silenceremove.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index b9a9e13caf..d826a22e9d 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -186,8 +186,17 @@ static int config_input(AVFilterLink *inlink)
 
     s->start_duration = av_rescale(s->start_duration, inlink->sample_rate,
                                    AV_TIME_BASE);
+    if (s->start_duration < 0) {
+        av_log(ctx, AV_LOG_WARNING, "start duration must be non-negative\n");
+        s->start_duration = -s->start_duration;
+    }
+
     s->stop_duration  = av_rescale(s->stop_duration, inlink->sample_rate,
                                    AV_TIME_BASE);
+    if (s->stop_duration < 0) {
+        av_log(ctx, AV_LOG_WARNING, "stop duration must be non-negative\n");
+        s->stop_duration = -s->stop_duration;
+    }
 
     s->start_holdoff = av_malloc_array(FFMAX(s->start_duration, 1),
                                        sizeof(*s->start_holdoff) *



More information about the ffmpeg-cvslog mailing list