libavfilter/vf_fieldorder.c:213: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`.

libavfilter/vf_fieldorder.c:213:5: Call
211. 
212.     avfilter_end_frame(outlink);
213.     avfilter_unref_buffer(inpicref);
         ^
214. }
215. 

libavfilter/avfilter.c:72:1: <LHS trace>
70. }
71. 
72. void avfilter_unref_buffer(AVFilterBufferRef *ref)
    ^
73. {
74.     if (!ref)

libavfilter/avfilter.c:72:1: Parameter `ref->buf->refcount`
  70. }
  71. 
  72. void avfilter_unref_buffer(AVFilterBufferRef *ref)
      ^
  73. {
  74.     if (!ref)

libavfilter/avfilter.c:76:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 
  74.     if (!ref)
  75.         return;
  76.     if (!(--ref->buf->refcount))
                ^
  77.         ref->buf->free(ref->buf);
  78.     av_free(ref->video);

void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
    if (!ref)
        return;
    if (!(--ref->buf->refcount))
        ref->buf->free(ref->buf);
    av_free(ref->video);
    av_free(ref->audio);
    av_free(ref);
}
['static void end_frame(AVFilterLink *inlink)\n{\n    AVFilterContext   *ctx        = inlink->dst;\n    FieldOrderContext *fieldorder = ctx->priv;\n    AVFilterLink      *outlink    = ctx->outputs[0];\n    AVFilterBufferRef *inpicref   = inlink->cur_buf;\n    AVFilterBufferRef *outpicref  = outlink->out_buf;\n    int               h, w, plane, line_step, line_size, line;\n    uint8_t           *cpy_src, *cpy_dst;\n    if (    inpicref->video->interlaced\n         && inpicref->video->top_field_first != fieldorder->dst_tff) {\n        av_dlog(ctx,\n                "picture will move %s one line\\n",\n                fieldorder->dst_tff ? "up" : "down");\n        h = inpicref->video->h;\n        w = inpicref->video->w;\n        for (plane = 0; plane < 4 && inpicref->data[plane]; plane++) {\n            line_step = inpicref->linesize[plane];\n            line_size = fieldorder->line_size[plane];\n            cpy_src = inpicref->data[plane];\n            cpy_dst = outpicref->data[plane];\n            if (fieldorder->dst_tff) {\n                for (line = 0; line < h; line++) {\n                    if (1 + line < outpicref->video->h) {\n                        memcpy(cpy_dst, cpy_src + line_step, line_size);\n                    } else {\n                        memcpy(cpy_dst, cpy_src - line_step - line_step, line_size);\n                    }\n                    cpy_src += line_step;\n                    cpy_dst += line_step;\n                }\n            } else {\n                cpy_src += (h - 1) * line_step;\n                cpy_dst += (h - 1) * line_step;\n                for (line = h - 1; line >= 0 ; line--) {\n                    if (line > 0) {\n                        memcpy(cpy_dst, cpy_src - line_step, line_size);\n                    } else {\n                        memcpy(cpy_dst, cpy_src + line_step + line_step, line_size);\n                    }\n                    cpy_src -= line_step;\n                    cpy_dst -= line_step;\n                }\n            }\n        }\n        outpicref->video->top_field_first = fieldorder->dst_tff;\n        avfilter_draw_slice(outlink, 0, h, 1);\n    } else {\n        av_dlog(ctx,\n                "not interlaced or field order already correct\\n");\n    }\n    avfilter_end_frame(outlink);\n    avfilter_unref_buffer(inpicref);\n}', 'void avfilter_unref_buffer(AVFilterBufferRef *ref)\n{\n    if (!ref)\n        return;\n    if (!(--ref->buf->refcount))\n        ref->buf->free(ref->buf);\n    av_free(ref->video);\n    av_free(ref->audio);\n    av_free(ref);\n}']