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

libavfilter/af_resample.c:193:17: Assignment
191.                 av_log(ctx, AV_LOG_WARNING, "First timestamp is missing, "
192.                        "assuming 0.\n");
193.                 s->next_pts = 0;
                     ^
194.             } else
195.                 s->next_pts = av_rescale_q(buf->pts, inlink->time_base,

libavfilter/af_resample.c:207:17: Assignment
205.                                           inlink->sample_rate);
206.             } else
207.                 buf_out->pts = s->next_pts;
                     ^
208. 
209.             s->next_pts = buf_out->pts + buf_out->audio->nb_samples;

libavfilter/af_resample.c:211:13: Call
209.             s->next_pts = buf_out->pts + buf_out->audio->nb_samples;
210. 
211.             ff_filter_samples(outlink, buf_out);
                 ^
212.         }
213.         avfilter_unref_buffer(buf);

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:203:9: Call
  201.                         link->format);
  202. 
  203.         avfilter_unref_buffer(samplesref);
               ^
  204.     } else
  205.         link->cur_buf = 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    ResampleContext    *s = ctx->priv;\n    AVFilterLink *outlink = ctx->outputs[0];\n    if (s->avr) {\n        AVFilterBufferRef *buf_out;\n        int delay, nb_samples, ret;\n        delay      = avresample_get_delay(s->avr);\n        nb_samples = av_rescale_rnd(buf->audio->nb_samples + delay,\n                                    outlink->sample_rate, inlink->sample_rate,\n                                    AV_ROUND_UP);\n        buf_out = ff_get_audio_buffer(outlink, AV_PERM_WRITE, nb_samples);\n        ret     = avresample_convert(s->avr, (void**)buf_out->extended_data,\n                                     buf_out->linesize[0], nb_samples,\n                                     (void**)buf->extended_data, buf->linesize[0],\n                                     buf->audio->nb_samples);\n        av_assert0(!avresample_available(s->avr));\n        if (s->next_pts == AV_NOPTS_VALUE) {\n            if (buf->pts == AV_NOPTS_VALUE) {\n                av_log(ctx, AV_LOG_WARNING, "First timestamp is missing, "\n                       "assuming 0.\\n");\n                s->next_pts = 0;\n            } else\n                s->next_pts = av_rescale_q(buf->pts, inlink->time_base,\n                                           outlink->time_base);\n        }\n        if (ret > 0) {\n            buf_out->audio->nb_samples = ret;\n            if (buf->pts != AV_NOPTS_VALUE) {\n                buf_out->pts = av_rescale_q(buf->pts, inlink->time_base,\n                                            outlink->time_base) -\n                               av_rescale(delay, outlink->sample_rate,\n                                          inlink->sample_rate);\n            } else\n                buf_out->pts = s->next_pts;\n            s->next_pts = buf_out->pts + buf_out->audio->nb_samples;\n            ff_filter_samples(outlink, buf_out);\n        }\n        avfilter_unref_buffer(buf);\n    } else\n        ff_filter_samples(outlink, buf);\n}', 'void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)\n{\n    void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);\n    AVFilterPad *dst = link->dstpad;\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        link->cur_buf = ff_default_get_audio_buffer(link, dst->min_perms,\n                                                    samplesref->audio->nb_samples);\n        link->cur_buf->pts                = samplesref->pts;\n        link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;\n        av_samples_copy(link->cur_buf->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        link->cur_buf = samplesref;\n    filter_samples(link, link->cur_buf);\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}']