libavresample/utils.c:619: error: Integer Overflow L2
  ([1, 2147483616] + 32):signed32 by call to `av_frame_get_buffer`.

libavresample/utils.c:618:31: Call
616.     if (out) {
617.         if (!out->linesize[0]) {
618.             out->nb_samples = avresample_get_out_samples(avr, in->nb_samples);
                                   ^
619.             if ((ret = av_frame_get_buffer(out, 0)) < 0) {
620.                 if (setup)

libavresample/utils.c:763:9: Assignment
  761. 
  762.     if (samples > INT_MAX)
  763.         return AVERROR(EINVAL);
               ^
  764. 
  765.     return samples;

libavresample/utils.c:618:13: Assignment
616.     if (out) {
617.         if (!out->linesize[0]) {
618.             out->nb_samples = avresample_get_out_samples(avr, in->nb_samples);
                 ^
619.             if ((ret = av_frame_get_buffer(out, 0)) < 0) {
620.                 if (setup)

libavresample/utils.c:619:24: Call
617.         if (!out->linesize[0]) {
618.             out->nb_samples = avresample_get_out_samples(avr, in->nb_samples);
619.             if ((ret = av_frame_get_buffer(out, 0)) < 0) {
                            ^
620.                 if (setup)
621.                     avresample_close(avr);

libavutil/frame.c:175:1: Parameter `frame->nb_samples`
  173. }
  174. 
  175. int av_frame_get_buffer(AVFrame *frame, int align)
       ^
  176. {
  177.     if (frame->format < 0)

libavutil/frame.c:183:16: Call
  181.         return get_video_buffer(frame, align);
  182.     else if (frame->nb_samples > 0 && frame->channel_layout)
  183.         return get_audio_buffer(frame, align);
                      ^
  184. 
  185.     return AVERROR(EINVAL);

libavutil/frame.c:126:1: Parameter `frame->nb_samples`
    124. }
    125. 
    126. static int get_audio_buffer(AVFrame *frame, int align)
         ^
    127. {
    128.     int channels = av_get_channel_layout_nb_channels(frame->channel_layout);

libavutil/frame.c:134:15: Call
    132. 
    133.     if (!frame->linesize[0]) {
    134.         ret = av_samples_get_buffer_size(&frame->linesize[0], channels,
                       ^
    135.                                          frame->nb_samples, frame->format,
    136.                                          align);

libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107. 
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
     ^
109.                                enum AVSampleFormat sample_fmt, int align)
110. {

libavutil/samplefmt.c:108:1: Parameter `nb_samples`
      106. }
      107. 
      108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
           ^
      109.                                enum AVSampleFormat sample_fmt, int align)
      110. {

libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `av_frame_get_buffer` 
      122.             return AVERROR(EINVAL);
      123.         align = 1;
      124.         nb_samples = FFALIGN(nb_samples, 32);
                   ^
      125.     }
      126. 

int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
                               enum AVSampleFormat sample_fmt, int align)
{
    int line_size;
    int sample_size = av_get_bytes_per_sample(sample_fmt);
    int planar      = av_sample_fmt_is_planar(sample_fmt);
    if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
        return AVERROR(EINVAL);
    if (!align) {
        if (nb_samples > INT_MAX - 31)
            return AVERROR(EINVAL);
        align = 1;
        nb_samples = FFALIGN(nb_samples, 32);
    }
    if (nb_channels > INT_MAX / align ||
        (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
        return AVERROR(EINVAL);
    line_size = planar ? FFALIGN(nb_samples * sample_size,               align) :
                         FFALIGN(nb_samples * sample_size * nb_channels, align);
    if (linesize)
        *linesize = line_size;
    return planar ? line_size * nb_channels : line_size;
}
['int avresample_convert_frame(AVAudioResampleContext *avr,\n                             AVFrame *out, AVFrame *in)\n{\n    int ret, setup = 0;\n    if (!avresample_is_open(avr)) {\n        if ((ret = avresample_config(avr, out, in)) < 0)\n            return ret;\n        if ((ret = avresample_open(avr)) < 0)\n            return ret;\n        setup = 1;\n    } else {\n        if ((ret = config_changed(avr, out, in)))\n            return ret;\n    }\n    if (out) {\n        if (!out->linesize[0]) {\n            out->nb_samples = avresample_get_out_samples(avr, in->nb_samples);\n            if ((ret = av_frame_get_buffer(out, 0)) < 0) {\n                if (setup)\n                    avresample_close(avr);\n                return ret;\n            }\n        } else {\n            if (!out->nb_samples)\n                out->nb_samples = available_samples(out);\n        }\n    }\n    return convert_frame(avr, out, in);\n}', 'int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples)\n{\n    int64_t samples = avresample_get_delay(avr) + (int64_t)in_nb_samples;\n    if (avr->resample_needed) {\n        samples = av_rescale_rnd(samples,\n                                 avr->out_sample_rate,\n                                 avr->in_sample_rate,\n                                 AV_ROUND_UP);\n    }\n    samples += avresample_available(avr);\n    if (samples > INT_MAX)\n        return AVERROR(EINVAL);\n    return samples;\n}', 'int av_frame_get_buffer(AVFrame *frame, int align)\n{\n    if (frame->format < 0)\n        return AVERROR(EINVAL);\n    if (frame->width > 0 && frame->height > 0)\n        return get_video_buffer(frame, align);\n    else if (frame->nb_samples > 0 && frame->channel_layout)\n        return get_audio_buffer(frame, align);\n    return AVERROR(EINVAL);\n}', 'static int get_audio_buffer(AVFrame *frame, int align)\n{\n    int channels = av_get_channel_layout_nb_channels(frame->channel_layout);\n    int planar   = av_sample_fmt_is_planar(frame->format);\n    int planes   = planar ? channels : 1;\n    int ret, i;\n    if (!frame->linesize[0]) {\n        ret = av_samples_get_buffer_size(&frame->linesize[0], channels,\n                                         frame->nb_samples, frame->format,\n                                         align);\n        if (ret < 0)\n            return ret;\n    }\n    if (planes > AV_NUM_DATA_POINTERS) {\n        frame->extended_data = av_mallocz(planes *\n                                          sizeof(*frame->extended_data));\n        frame->extended_buf  = av_mallocz((planes - AV_NUM_DATA_POINTERS) *\n                                          sizeof(*frame->extended_buf));\n        if (!frame->extended_data || !frame->extended_buf) {\n            av_freep(&frame->extended_data);\n            av_freep(&frame->extended_buf);\n            return AVERROR(ENOMEM);\n        }\n        frame->nb_extended_buf = planes - AV_NUM_DATA_POINTERS;\n    } else\n        frame->extended_data = frame->data;\n    for (i = 0; i < FFMIN(planes, AV_NUM_DATA_POINTERS); i++) {\n        frame->buf[i] = av_buffer_alloc(frame->linesize[0]);\n        if (!frame->buf[i]) {\n            av_frame_unref(frame);\n            return AVERROR(ENOMEM);\n        }\n        frame->extended_data[i] = frame->data[i] = frame->buf[i]->data;\n    }\n    for (i = 0; i < planes - AV_NUM_DATA_POINTERS; i++) {\n        frame->extended_buf[i] = av_buffer_alloc(frame->linesize[0]);\n        if (!frame->extended_buf[i]) {\n            av_frame_unref(frame);\n            return AVERROR(ENOMEM);\n        }\n        frame->extended_data[i + AV_NUM_DATA_POINTERS] = frame->extended_buf[i]->data;\n    }\n    return 0;\n}', 'int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,\n                               enum AVSampleFormat sample_fmt, int align)\n{\n    int line_size;\n    int sample_size = av_get_bytes_per_sample(sample_fmt);\n    int planar      = av_sample_fmt_is_planar(sample_fmt);\n    if (!sample_size || nb_samples <= 0 || nb_channels <= 0)\n        return AVERROR(EINVAL);\n    if (!align) {\n        if (nb_samples > INT_MAX - 31)\n            return AVERROR(EINVAL);\n        align = 1;\n        nb_samples = FFALIGN(nb_samples, 32);\n    }\n    if (nb_channels > INT_MAX / align ||\n        (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)\n        return AVERROR(EINVAL);\n    line_size = planar ? FFALIGN(nb_samples * sample_size,               align) :\n                         FFALIGN(nb_samples * sample_size * nb_channels, align);\n    if (linesize)\n        *linesize = line_size;\n    return planar ? line_size * nb_channels : line_size;\n}']