aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-09-30 12:57:26 +0200
committerPaul B Mahol <onemda@gmail.com>2019-09-30 12:58:06 +0200
commit8b36968ef465a01dbb32bdfc6d1c41dd0a8b8158 (patch)
tree99fa9b177af0fff738c4860cfbd32ed8de855232
parenta6e2cf5eb0444f90b6d979f999f32def0b52b17e (diff)
downloadffmpeg-8b36968ef465a01dbb32bdfc6d1c41dd0a8b8158.tar.gz
avfilter/trim: drop all audio frames instead of asserting
-rw-r--r--libavfilter/trim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/trim.c b/libavfilter/trim.c
index 1dbbabbb93..889fe96b9b 100644
--- a/libavfilter/trim.c
+++ b/libavfilter/trim.c
@@ -300,7 +300,8 @@ static int atrim_filter_frame(AVFilterLink *inlink, AVFrame *frame)
s->nb_samples += frame->nb_samples;
start_sample = FFMAX(0, start_sample);
end_sample = FFMIN(frame->nb_samples, end_sample);
- av_assert0(start_sample < end_sample || (start_sample == end_sample && !frame->nb_samples));
+ if (start_sample >= end_sample || !frame->nb_samples)
+ goto drop;
if (start_sample) {
AVFrame *out = ff_get_audio_buffer(ctx->outputs[0], end_sample - start_sample);