Skip to content
Snippets Groups Projects
Commit 15b385ef authored by Paul B Mahol's avatar Paul B Mahol Committed by Carl Eugen Hoyos
Browse files

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


Signed-off-by: default avatarPaul B Mahol <onemda@gmail.com>

Fixes ticket #7697.
(cherry picked from commit 2d1594a8)
parent cb74b3ff
No related branches found
No related tags found
No related merge requests found
......@@ -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) *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment