avfilter/trim: Fix assertion failure with empty frames
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Aug 2013 09:51:20 +0000 (11:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Aug 2013 09:54:40 +0000 (11:54 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/trim.c

index 6fa3c0c..9109e77 100644 (file)
@@ -322,7 +322,7 @@ 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);
+    av_assert0(start_sample < end_sample || (start_sample == end_sample && !frame->nb_samples));
 
     if (start_sample) {
         AVFrame *out = ff_get_audio_buffer(ctx->outputs[0], end_sample - start_sample);