libavcodec/h261dec.c:642: error: Integer Overflow L2
  ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`.

libavcodec/h261dec.c:640:5: Unknown value from: __infer_skip
638. 
639.     assert(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type);
640.     assert(s->current_picture.f->pict_type == s->pict_type);
         ^
641. 
642.     if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)

libavcodec/h261dec.c:642:16: Call
640.     assert(s->current_picture.f->pict_type == s->pict_type);
641. 
642.     if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
                    ^
643.         return ret;
644.     ff_print_debug_info(s, s->current_picture_ptr);

libavutil/frame.c:188:1: Parameter `src->nb_samples`
  186. }
  187. 
  188. int av_frame_ref(AVFrame *dst, const AVFrame *src)
       ^
  189. {
  190.     int i, ret = 0;

libavutil/frame.c:196:5: Assignment
  194.     dst->height         = src->height;
  195.     dst->channel_layout = src->channel_layout;
  196.     dst->nb_samples     = src->nb_samples;
           ^
  197. 
  198.     ret = av_frame_copy_props(dst, src);

libavutil/frame.c:204:15: Call
  202.     /* duplicate the frame data if it's not refcounted */
  203.     if (!src->buf[0]) {
  204.         ret = av_frame_get_buffer(dst, 32);
                     ^
  205.         if (ret < 0)
  206.             return ret;

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_ref` 
        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;
}
['static int h261_decode_frame(AVCodecContext *avctx, void *data,\n                             int *got_frame, AVPacket *avpkt)\n{\n    const uint8_t *buf = avpkt->data;\n    int buf_size       = avpkt->size;\n    H261Context *h     = avctx->priv_data;\n    MpegEncContext *s  = &h->s;\n    int ret;\n    AVFrame *pict = data;\n    av_dlog(avctx, "*****frame %d size=%d\\n", avctx->frame_number, buf_size);\n    av_dlog(avctx, "bytes=%x %x %x %x\\n", buf[0], buf[1], buf[2], buf[3]);\n    s->flags  = avctx->flags;\n    s->flags2 = avctx->flags2;\n    h->gob_start_code_skipped = 0;\nretry:\n    init_get_bits(&s->gb, buf, buf_size * 8);\n    if (!s->context_initialized)\n        ff_mpv_idct_init(s);\n    ret = h261_decode_picture_header(h);\n    if (ret < 0) {\n        av_log(s->avctx, AV_LOG_ERROR, "header damaged\\n");\n        return -1;\n    }\n    if (s->width != avctx->coded_width || s->height != avctx->coded_height) {\n        ParseContext pc = s->parse_context;\n        s->parse_context.buffer = 0;\n        ff_mpv_common_end(s);\n        s->parse_context = pc;\n    }\n    if (!s->context_initialized) {\n        if ((ret = ff_mpv_common_init(s)) < 0)\n            return ret;\n        ret = ff_set_dimensions(avctx, s->width, s->height);\n        if (ret < 0)\n            return ret;\n        goto retry;\n    }\n    s->current_picture.f->pict_type = s->pict_type;\n    s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;\n    if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||\n        (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||\n         avctx->skip_frame >= AVDISCARD_ALL)\n        return get_consumed_bytes(s, buf_size);\n    if (ff_mpv_frame_start(s, avctx) < 0)\n        return -1;\n    ff_mpeg_er_frame_start(s);\n    s->mb_x = 0;\n    s->mb_y = 0;\n    while (h->gob_number < (s->mb_height == 18 ? 12 : 5)) {\n        if (h261_resync(h) < 0)\n            break;\n        h261_decode_gob(h);\n    }\n    ff_mpv_frame_end(s);\n    assert(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type);\n    assert(s->current_picture.f->pict_type == s->pict_type);\n    if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)\n        return ret;\n    ff_print_debug_info(s, s->current_picture_ptr);\n    *got_frame = 1;\n    return get_consumed_bytes(s, buf_size);\n}', 'int av_frame_ref(AVFrame *dst, const AVFrame *src)\n{\n    int i, ret = 0;\n    dst->format         = src->format;\n    dst->width          = src->width;\n    dst->height         = src->height;\n    dst->channel_layout = src->channel_layout;\n    dst->nb_samples     = src->nb_samples;\n    ret = av_frame_copy_props(dst, src);\n    if (ret < 0)\n        return ret;\n    if (!src->buf[0]) {\n        ret = av_frame_get_buffer(dst, 32);\n        if (ret < 0)\n            return ret;\n        ret = av_frame_copy(dst, src);\n        if (ret < 0)\n            av_frame_unref(dst);\n        return ret;\n    }\n    for (i = 0; i < FF_ARRAY_ELEMS(src->buf) && src->buf[i]; i++) {\n        dst->buf[i] = av_buffer_ref(src->buf[i]);\n        if (!dst->buf[i]) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n    }\n    if (src->extended_buf) {\n        dst->extended_buf = av_mallocz(sizeof(*dst->extended_buf) *\n                                       src->nb_extended_buf);\n        if (!dst->extended_buf) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        dst->nb_extended_buf = src->nb_extended_buf;\n        for (i = 0; i < src->nb_extended_buf; i++) {\n            dst->extended_buf[i] = av_buffer_ref(src->extended_buf[i]);\n            if (!dst->extended_buf[i]) {\n                ret = AVERROR(ENOMEM);\n                goto fail;\n            }\n        }\n    }\n    if (src->extended_data != src->data) {\n        int ch = av_get_channel_layout_nb_channels(src->channel_layout);\n        if (!ch) {\n            ret = AVERROR(EINVAL);\n            goto fail;\n        }\n        dst->extended_data = av_malloc(sizeof(*dst->extended_data) * ch);\n        if (!dst->extended_data) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        memcpy(dst->extended_data, src->extended_data, sizeof(*src->extended_data) * ch);\n    } else\n        dst->extended_data = dst->data;\n    memcpy(dst->data,     src->data,     sizeof(src->data));\n    memcpy(dst->linesize, src->linesize, sizeof(src->linesize));\n    return 0;\nfail:\n    av_frame_unref(dst);\n    return ret;\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}']