overlay: clear cur_buf on main input link.
authorNicolas George <nicolas.george@normalesup.org>
Sun, 22 Jul 2012 15:56:59 +0000 (17:56 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sun, 22 Jul 2012 16:35:28 +0000 (18:35 +0200)
A reference is kept in the queue and freed after use.

libavfilter/vf_overlay.c

index 680e074..9f8163d 100644 (file)
@@ -514,8 +514,11 @@ static void start_frame_main(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     flush_frames(ctx);
     inpicref->pts = av_rescale_q(inpicref->pts, ctx->inputs[MAIN]->time_base,
                                  ctx->outputs[0]->time_base);
-    if (try_start_frame(ctx, inpicref) < 0)
+    if (try_start_frame(ctx, inpicref) < 0) {
         ff_bufqueue_add(ctx, &over->queue_main, inpicref);
+        av_assert1(inpicref == inlink->cur_buf);
+        inlink->cur_buf = NULL;
+    }
 }
 
 static void draw_slice_main(AVFilterLink *inlink, int y, int h, int slice_dir)