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

libavfilter/vf_gradfun.c:230:5: Call
228.     avfilter_draw_slice(outlink, 0, inlink->h, 1);
229.     avfilter_end_frame(outlink);
230.     avfilter_unref_buffer(inpic);
         ^
231.     if (outpic != inpic)
232.         avfilter_unref_buffer(outpic);

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

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

libavfilter/avfilter.c:75:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 
  73.     if (!ref)
  74.         return;
  75.     if (!(--ref->buf->refcount))
                ^
  76.         ref->buf->free(ref->buf);
  77.     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    GradFunContext *gf = inlink->dst->priv;\n    AVFilterBufferRef *inpic = inlink->cur_buf;\n    AVFilterLink *outlink = inlink->dst->outputs[0];\n    AVFilterBufferRef *outpic = outlink->out_buf;\n    int p;\n    for (p = 0; p < 4 && inpic->data[p]; p++) {\n        int w = inlink->w;\n        int h = inlink->h;\n        int r = gf->radius;\n        if (p) {\n            w = gf->chroma_w;\n            h = gf->chroma_h;\n            r = gf->chroma_r;\n        }\n        if (FFMIN(w, h) > 2 * r)\n            filter(gf, outpic->data[p], inpic->data[p], w, h, outpic->linesize[p], inpic->linesize[p], r);\n        else if (outpic->data[p] != inpic->data[p])\n            av_image_copy_plane(outpic->data[p], outpic->linesize[p], inpic->data[p], inpic->linesize[p], w, h);\n    }\n    avfilter_draw_slice(outlink, 0, inlink->h, 1);\n    avfilter_end_frame(outlink);\n    avfilter_unref_buffer(inpic);\n    if (outpic != inpic)\n        avfilter_unref_buffer(outpic);\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}']