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

libavfilter/af_asyncts.c:232:9: Assignment
230.             avresample_set_compensation(s->avr, comp, inlink->sample_rate);
231.         }
232.         delta = 0;
             ^
233.     }
234. 

libavfilter/af_asyncts.c:250:17: Assignment
248. 
249.             for (ch = 0; ch < nb_channels; ch++)
250.                 buf_out->extended_data[ch] += delta;
                     ^
251. 
252.             avresample_read(s->avr, buf_out->extended_data, out_size);

libavfilter/af_asyncts.c:265:15: Call
263.         }
264.         buf_out->pts = s->pts;
265.         ret = ff_filter_frame(outlink, buf_out);
                   ^
266.         if (ret < 0)
267.             goto fail;

libavfilter/avfilter.c:459:1: Parameter `frame->buf->refcount`
  457. }
  458. 
  459. int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
       ^
  460. {
  461.     int (*filter_frame)(AVFilterLink *, AVFilterBufferRef *);

libavfilter/avfilter.c:493:13: Call
  491.         }
  492.         if (!out) {
  493.             avfilter_unref_buffer(frame);
                   ^
  494.             return AVERROR(ENOMEM);
  495.         }

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

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

libavfilter/buffer.c:79:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_filter_frame` 
    77.     if (!ref)
    78.         return;
    79.     if (!(--ref->buf->refcount))
                  ^
    80.         ref->buf->free(ref->buf);
    81.     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 filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)\n{\n    AVFilterContext  *ctx = inlink->dst;\n    ASyncContext       *s = ctx->priv;\n    AVFilterLink *outlink = ctx->outputs[0];\n    int nb_channels = av_get_channel_layout_nb_channels(buf->audio->channel_layout);\n    int64_t pts = (buf->pts == AV_NOPTS_VALUE) ? buf->pts :\n                  av_rescale_q(buf->pts, inlink->time_base, outlink->time_base);\n    int out_size, ret;\n    int64_t delta;\n    if (s->pts == AV_NOPTS_VALUE) {\n        if (pts != AV_NOPTS_VALUE) {\n            s->pts = pts - get_delay(s);\n        }\n        return write_to_fifo(s, buf);\n    }\n    if (pts == AV_NOPTS_VALUE) {\n        return write_to_fifo(s, buf);\n    }\n    if (s->first_pts != AV_NOPTS_VALUE) {\n        handle_trimming(ctx);\n        if (!avresample_available(s->avr))\n            return write_to_fifo(s, buf);\n    }\n    delta    = pts - s->pts - get_delay(s);\n    out_size = avresample_available(s->avr);\n    if (labs(delta) > s->min_delta || (s->first_frame && delta)) {\n        av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\\n", delta);\n        out_size = av_clipl_int32((int64_t)out_size + delta);\n    } else {\n        if (s->resample) {\n            int comp = av_clip(delta, -s->max_comp, s->max_comp);\n            av_log(ctx, AV_LOG_VERBOSE, "Compensating %d samples per second.\\n", comp);\n            avresample_set_compensation(s->avr, comp, inlink->sample_rate);\n        }\n        delta = 0;\n    }\n    if (out_size > 0) {\n        AVFilterBufferRef *buf_out = ff_get_audio_buffer(outlink, AV_PERM_WRITE,\n                                                         out_size);\n        if (!buf_out) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        if (s->first_frame && delta > 0) {\n            int ch;\n            av_samples_set_silence(buf_out->extended_data, 0, delta,\n                                   nb_channels, buf->format);\n            for (ch = 0; ch < nb_channels; ch++)\n                buf_out->extended_data[ch] += delta;\n            avresample_read(s->avr, buf_out->extended_data, out_size);\n            for (ch = 0; ch < nb_channels; ch++)\n                buf_out->extended_data[ch] -= delta;\n        } else {\n            avresample_read(s->avr, buf_out->extended_data, out_size);\n            if (delta > 0) {\n                av_samples_set_silence(buf_out->extended_data, out_size - delta,\n                                       delta, nb_channels, buf->format);\n            }\n        }\n        buf_out->pts = s->pts;\n        ret = ff_filter_frame(outlink, buf_out);\n        if (ret < 0)\n            goto fail;\n        s->got_output = 1;\n    } else if (avresample_available(s->avr)) {\n        av_log(ctx, AV_LOG_WARNING, "Non-monotonous timestamps, dropping "\n               "whole buffer.\\n");\n    }\n    avresample_read(s->avr, NULL, avresample_available(s->avr));\n    s->pts = pts - avresample_get_delay(s->avr);\n    ret = avresample_convert(s->avr, NULL, 0, 0, buf->extended_data,\n                             buf->linesize[0], buf->audio->nb_samples);\n    s->first_frame = 0;\nfail:\n    avfilter_unref_buffer(buf);\n    return ret;\n}', 'int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)\n{\n    int (*filter_frame)(AVFilterLink *, AVFilterBufferRef *);\n    AVFilterPad *dst = link->dstpad;\n    AVFilterBufferRef *out;\n    int perms = frame->perms;\n    FF_DPRINTF_START(NULL, filter_frame);\n    ff_dlog_link(NULL, link, 1);\n    if (!(filter_frame = dst->filter_frame))\n        filter_frame = default_filter_frame;\n    if (frame->linesize[0] < 0)\n        perms |= AV_PERM_NEG_LINESIZES;\n    if ((dst->min_perms & perms) != dst->min_perms ||\n        dst->rej_perms & perms) {\n        av_log(link->dst, AV_LOG_DEBUG,\n               "Copying data in avfilter (have perms %x, need %x, reject %x)\\n",\n               perms, link->dstpad->min_perms, link->dstpad->rej_perms);\n        switch (link->type) {\n        case AVMEDIA_TYPE_VIDEO:\n            out = ff_get_video_buffer(link, dst->min_perms,\n                                      link->w, link->h);\n            break;\n        case AVMEDIA_TYPE_AUDIO:\n            out = ff_get_audio_buffer(link, dst->min_perms,\n                                      frame->audio->nb_samples);\n            break;\n        default: return AVERROR(EINVAL);\n        }\n        if (!out) {\n            avfilter_unref_buffer(frame);\n            return AVERROR(ENOMEM);\n        }\n        avfilter_copy_buffer_ref_props(out, frame);\n        switch (link->type) {\n        case AVMEDIA_TYPE_VIDEO:\n            av_image_copy(out->data, out->linesize, frame->data, frame->linesize,\n                          frame->format, frame->video->w, frame->video->h);\n            break;\n        case AVMEDIA_TYPE_AUDIO:\n            av_samples_copy(out->extended_data, frame->extended_data,\n                            0, 0, frame->audio->nb_samples,\n                            av_get_channel_layout_nb_channels(frame->audio->channel_layout),\n                            frame->format);\n            break;\n        default: return AVERROR(EINVAL);\n        }\n        avfilter_unref_buffer(frame);\n    } else\n        out = frame;\n    return filter_frame(link, out);\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}']