static void end_last_frame(AVFilterContext *ctx)
{
    TileContext *tile    = ctx->priv;
    AVFilterLink *outlink = ctx->outputs[0];
    AVFilterBufferRef *out_buf = outlink->out_buf;

    outlink->out_buf = NULL;
    while (tile->current < tile->nb_frames)
        draw_blank_frame(ctx, out_buf);
    ff_filter_frame(outlink, out_buf);
    tile->current = 0;
}