lavfi/fifo: do not assume request_frame() returns a frame.
authorNicolas George <george@nsup.org>
Thu, 22 Oct 2015 07:57:34 +0000 (09:57 +0200)
committerNicolas George <george@nsup.org>
Sat, 7 Nov 2015 15:43:36 +0000 (16:43 +0100)
libavfilter/fifo.c

index e477cff..f0b77ff 100644 (file)
@@ -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) {