avfilter/trim: drop all audio frames instead of asserting
authorPaul B Mahol <onemda@gmail.com>
Mon, 30 Sep 2019 10:57:26 +0000 (12:57 +0200)
committerPaul B Mahol <onemda@gmail.com>
Mon, 30 Sep 2019 10:58:06 +0000 (12:58 +0200)
libavfilter/trim.c

index 1dbbabb..889fe96 100644 (file)
@@ -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);