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

libavfilter/af_asyncts.c:202:9: Assignment
200. 
201.         avresample_read(s->avr, (void**)buf_out->extended_data, out_size);
202.         buf_out->pts = s->pts;
             ^
203. 
204.         if (delta > 0) {

libavfilter/af_asyncts.c:208:9: Call
206.                                    delta, nb_channels, buf->format);
207.         }
208.         ff_filter_samples(outlink, buf_out);
             ^
209.     } else {
210.         av_log(ctx, AV_LOG_WARNING, "Non-monotonous timestamps, dropping "

libavfilter/audio.c:175:1: Parameter `samplesref->buf->refcount`
  173. }
  174. 
  175. void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
       ^
  176. {
  177.     void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);

libavfilter/audio.c:204:9: Call
  202.                         link->format);
  203. 
  204.         avfilter_unref_buffer(samplesref);
               ^
  205.     } else
  206.         buf_out = samplesref;

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 `ff_filter_samples` 
    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 void filter_samples(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;\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        write_to_fifo(s, buf);\n        return;\n    }\n    if (pts == AV_NOPTS_VALUE) {\n        write_to_fifo(s, buf);\n        return;\n    }\n    delta    = pts - s->pts - get_delay(s);\n    out_size = avresample_available(s->avr);\n    if (labs(delta) > s->min_delta) {\n        av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\\n", delta);\n        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, delta, 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            return;\n        avresample_read(s->avr, (void**)buf_out->extended_data, out_size);\n        buf_out->pts = s->pts;\n        if (delta > 0) {\n            av_samples_set_silence(buf_out->extended_data, out_size - delta,\n                                   delta, nb_channels, buf->format);\n        }\n        ff_filter_samples(outlink, buf_out);\n    } else {\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    avresample_convert(s->avr, NULL, 0, 0, (void**)buf->extended_data,\n                       buf->linesize[0], buf->audio->nb_samples);\n    avfilter_unref_buffer(buf);\n}', 'void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)\n{\n    void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);\n    AVFilterPad *dst = link->dstpad;\n    AVFilterBufferRef *buf_out;\n    FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1);\n    if (!(filter_samples = dst->filter_samples))\n        filter_samples = ff_default_filter_samples;\n    if ((dst->min_perms & samplesref->perms) != dst->min_perms ||\n        dst->rej_perms & samplesref->perms) {\n        av_log(link->dst, AV_LOG_DEBUG,\n               "Copying audio data in avfilter (have perms %x, need %x, reject %x)\\n",\n               samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms);\n        buf_out = ff_default_get_audio_buffer(link, dst->min_perms,\n                                              samplesref->audio->nb_samples);\n        buf_out->pts                = samplesref->pts;\n        buf_out->audio->sample_rate = samplesref->audio->sample_rate;\n        av_samples_copy(buf_out->extended_data, samplesref->extended_data,\n                        0, 0, samplesref->audio->nb_samples,\n                        av_get_channel_layout_nb_channels(link->channel_layout),\n                        link->format);\n        avfilter_unref_buffer(samplesref);\n    } else\n        buf_out = samplesref;\n    filter_samples(link, buf_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}']