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

libavfilter/fifo.c:143:1: Parameter `ctx->priv->allocated_samples`
141. }
142. 
143. static int return_audio_frame(AVFilterContext *ctx)
     ^
144. {
145.     AVFilterLink *link = ctx->outputs[0];

libavfilter/fifo.c:181:23: Assignment
179. 
180.         while (s->buf_out->audio->nb_samples < s->allocated_samples) {
181.             int len = FFMIN(s->allocated_samples - s->buf_out->audio->nb_samples,
                           ^
182.                             head->audio->nb_samples);
183. 

libavfilter/fifo.c:181:13: Assignment
179. 
180.         while (s->buf_out->audio->nb_samples < s->allocated_samples) {
181.             int len = FFMIN(s->allocated_samples - s->buf_out->audio->nb_samples,
                 ^
182.                             head->audio->nb_samples);
183. 

libavfilter/fifo.c:187:13: Assignment
185.                             s->buf_out->audio->nb_samples, 0, len, nb_channels,
186.                             link->format);
187.             s->buf_out->audio->nb_samples += len;
                 ^
188. 
189.             if (len == head->audio->nb_samples) {

libavfilter/fifo.c:190:17: Call
188. 
189.             if (len == head->audio->nb_samples) {
190.                 avfilter_unref_buffer(head);
                     ^
191.                 queue_pop(s);
192. 

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

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

libavfilter/buffer.c:78:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 
  76.     if (!ref)
  77.         return;
  78.     if (!(--ref->buf->refcount))
                ^
  79.         ref->buf->free(ref->buf);
  80.     if (ref->extended_data != ref->data)

void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
    if (!ref)
        return;
    if (!(--ref->buf->refcount))
        ref->buf->free(ref->buf);
    if (ref->extended_data != ref->data)
        av_freep(&ref->extended_data);
    av_free(ref->video);
    av_free(ref->audio);
    av_free(ref);
}
['static int return_audio_frame(AVFilterContext *ctx)\n{\n    AVFilterLink *link = ctx->outputs[0];\n    FifoContext *s = ctx->priv;\n    AVFilterBufferRef *head = s->root.next->buf;\n    AVFilterBufferRef *buf_out;\n    int ret;\n    if (!s->buf_out &&\n        head->audio->nb_samples >= link->request_samples &&\n        calc_ptr_alignment(head) >= 32) {\n        if (head->audio->nb_samples == link->request_samples) {\n            buf_out = head;\n            queue_pop(s);\n        } else {\n            buf_out = avfilter_ref_buffer(head, AV_PERM_READ);\n            buf_out->audio->nb_samples = link->request_samples;\n            buffer_offset(link, head, link->request_samples);\n        }\n    } else {\n        int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);\n        if (!s->buf_out) {\n            s->buf_out = ff_get_audio_buffer(link, AV_PERM_WRITE,\n                                             link->request_samples);\n            if (!s->buf_out)\n                return AVERROR(ENOMEM);\n            s->buf_out->audio->nb_samples = 0;\n            s->buf_out->pts               = head->pts;\n            s->allocated_samples          = link->request_samples;\n        } else if (link->request_samples != s->allocated_samples) {\n            av_log(ctx, AV_LOG_ERROR, "request_samples changed before the "\n                   "buffer was returned.\\n");\n            return AVERROR(EINVAL);\n        }\n        while (s->buf_out->audio->nb_samples < s->allocated_samples) {\n            int len = FFMIN(s->allocated_samples - s->buf_out->audio->nb_samples,\n                            head->audio->nb_samples);\n            av_samples_copy(s->buf_out->extended_data, head->extended_data,\n                            s->buf_out->audio->nb_samples, 0, len, nb_channels,\n                            link->format);\n            s->buf_out->audio->nb_samples += len;\n            if (len == head->audio->nb_samples) {\n                avfilter_unref_buffer(head);\n                queue_pop(s);\n                if (!s->root.next &&\n                    (ret = ff_request_frame(ctx->inputs[0])) < 0) {\n                    if (ret == AVERROR_EOF) {\n                        av_samples_set_silence(s->buf_out->extended_data,\n                                               s->buf_out->audio->nb_samples,\n                                               s->allocated_samples -\n                                               s->buf_out->audio->nb_samples,\n                                               nb_channels, link->format);\n                        s->buf_out->audio->nb_samples = s->allocated_samples;\n                        break;\n                    }\n                    return ret;\n                }\n                head = s->root.next->buf;\n            } else {\n                buffer_offset(link, head, len);\n            }\n        }\n        buf_out = s->buf_out;\n        s->buf_out = NULL;\n    }\n    ff_filter_samples(link, buf_out);\n    return 0;\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    if (ref->extended_data != ref->data)\n        av_freep(&ref->extended_data);\n    av_free(ref->video);\n    av_free(ref->audio);\n    av_free(ref);\n}']