From 67d3f5296ea6dce884ac53f2ea37f45dabaa8bb3 Mon Sep 17 00:00:00 2001
From: Nicolas George <george@nsup.org>
Date: Thu, 22 Oct 2015 09:57:34 +0200
Subject: [PATCH] lavfi/fifo: do not assume request_frame() returns a frame.

---
 libavfilter/fifo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index e477cff4cd3..f0b77ffb346 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -201,7 +201,8 @@ static int return_audio_frame(AVFilterContext *ctx)
                     break;
                 } else if (ret < 0)
                     return ret;
-                av_assert0(s->root.next); // If ff_request_frame() succeeded then we should have a frame
+                if (!s->root.next)
+                    return 0;
             }
             head = s->root.next->frame;
 
@@ -237,7 +238,8 @@ static int request_frame(AVFilterLink *outlink)
                 return return_audio_frame(outlink->src);
             return ret;
         }
-        av_assert0(fifo->root.next);
+        if (!fifo->root.next)
+            return 0;
     }
 
     if (outlink->request_samples) {
-- 
GitLab