[FFmpeg-devel] [PATCH] lavfi/vf_overlay: check that filter_frame does not return EAGAIN.

Nicolas George nicolas.george at normalesup.org
Thu Jan 10 20:11:41 CET 2013

EAGAIN is used internally in the code; it currently does not make
sens as a return code from the next filter.

Should fix CID966655.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
 libavfilter/vf_overlay.c |    1 +
 1 file changed, 1 insertion(+)

I would prefer to test whether it convinces Coverity without pushing it
to the official repository, but I do not know whether it is possible.

The assert is useful anyway: if someone decides to get a filter to return
EAGAIN, overlay will need adapting.

diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index b71ef41..d44677f 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -473,6 +473,7 @@ static int try_filter_frame(AVFilterContext *ctx, AVFilterBufferRef *mainpic)
     if (over->overpicref)
         blend_image(ctx, mainpic, over->overpicref, over->x, over->y);
     ret = ff_filter_frame(ctx->outputs[0], mainpic);
+    av_assert1(ret != AVERROR(EAGAIN));
     over->frame_requested = 0;
     return ret;

More information about the ffmpeg-devel mailing list