avconv.c:1798: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`.

avconv.c:1787:17: Call
1785.                     ost->st->codec->sample_aspect_ratio = picref->video->pixel_aspect;
1786. 
1787.                 do_video_out(of->ctx, ost, filtered_frame, &frame_size,
                      ^
1788.                              same_quant ? ost->last_quality :
1789.                                           ost->st->codec->global_quality);

avconv.c:1650:13: Call
  1648.             pkt.flags |= AV_PKT_FLAG_KEY;
  1649. 
  1650.             write_frame(s, &pkt, ost);
                    ^
  1651.         } else {
  1652.             int got_packet;

avconv.c:1798:13: Call
1796.             }
1797. 
1798.             avfilter_unref_buffer(picref);
                  ^
1799.         }
1800.     }

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

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

libavfilter/avfilter.c:77:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 
  75.     if (!ref)
  76.         return;
  77.     if (!(--ref->buf->refcount))
                ^
  78.         ref->buf->free(ref->buf);
  79.     av_free(ref->video);

void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
    if (!ref)
        return;
    if (!(--ref->buf->refcount))
        ref->buf->free(ref->buf);
    av_free(ref->video);
    av_free(ref->audio);
    av_free(ref);
}
['static int poll_filters(void)\n{\n    AVFilterBufferRef *picref;\n    AVFrame *filtered_frame = NULL;\n    int i, frame_size, ret;\n    for (i = 0; i < nb_output_streams; i++) {\n        OutputStream *ost = output_streams[i];\n        OutputFile    *of = output_files[ost->file_index];\n        if (!ost->filter || ost->is_past_recording_time)\n            continue;\n        if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) {\n            return AVERROR(ENOMEM);\n        } else\n            avcodec_get_frame_defaults(ost->filtered_frame);\n        filtered_frame = ost->filtered_frame;\n        while (avfilter_poll_frame(ost->filter->filter->inputs[0])) {\n            AVRational ist_pts_tb;\n            if ((ret = get_filtered_video_frame(ost->filter->filter,\n                                                filtered_frame, &picref,\n                                                &ist_pts_tb)) < 0)\n                return ret;\n            filtered_frame->pts = av_rescale_q(picref->pts, ist_pts_tb, AV_TIME_BASE_Q);\n            if (of->start_time && filtered_frame->pts < of->start_time)\n                return 0;\n            switch (ost->filter->filter->inputs[0]->type) {\n            case AVMEDIA_TYPE_VIDEO:\n                if (!ost->frame_aspect_ratio)\n                    ost->st->codec->sample_aspect_ratio = picref->video->pixel_aspect;\n                do_video_out(of->ctx, ost, filtered_frame, &frame_size,\n                             same_quant ? ost->last_quality :\n                                          ost->st->codec->global_quality);\n                if (vstats_filename && frame_size)\n                    do_video_stats(of->ctx, ost, frame_size);\n                break;\n            default:\n                av_assert0(0);\n            }\n            avfilter_unref_buffer(picref);\n        }\n    }\n    return 0;\n}', 'static void do_video_out(AVFormatContext *s,\n                         OutputStream *ost,\n                         AVFrame *in_picture,\n                         int *frame_size, float quality)\n{\n    int nb_frames, i, ret, format_video_sync;\n    AVCodecContext *enc;\n    double sync_ipts, delta;\n    enc = ost->st->codec;\n    sync_ipts = get_sync_ipts(ost, in_picture->pts) / av_q2d(enc->time_base);\n    delta = sync_ipts - ost->sync_opts;\n    nb_frames = 1;\n    *frame_size = 0;\n    format_video_sync = video_sync_method;\n    if (format_video_sync == VSYNC_AUTO)\n        format_video_sync = (s->oformat->flags & AVFMT_NOTIMESTAMPS) ? VSYNC_PASSTHROUGH :\n                            (s->oformat->flags & AVFMT_VARIABLE_FPS) ? VSYNC_VFR : VSYNC_CFR;\n    switch (format_video_sync) {\n    case VSYNC_CFR:\n        if (delta < -1.1)\n            nb_frames = 0;\n        else if (delta > 1.1)\n            nb_frames = lrintf(delta);\n        break;\n    case VSYNC_VFR:\n        if (delta <= -0.6)\n            nb_frames = 0;\n        else if (delta > 0.6)\n            ost->sync_opts = lrintf(sync_ipts);\n        break;\n    case VSYNC_PASSTHROUGH:\n        ost->sync_opts = lrintf(sync_ipts);\n        break;\n    default:\n        av_assert0(0);\n    }\n    nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);\n    if (nb_frames == 0) {\n        nb_frames_drop++;\n        av_log(NULL, AV_LOG_VERBOSE, "*** drop!\\n");\n        return;\n    } else if (nb_frames > 1) {\n        nb_frames_dup += nb_frames - 1;\n        av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\\n", nb_frames - 1);\n    }\n    if (!ost->frame_number)\n        ost->first_pts = ost->sync_opts;\n    for (i = 0; i < nb_frames; i++) {\n        AVPacket pkt;\n        av_init_packet(&pkt);\n        pkt.data = NULL;\n        pkt.size = 0;\n        if (!check_recording_time(ost))\n            return;\n        if (s->oformat->flags & AVFMT_RAWPICTURE &&\n            enc->codec->id == CODEC_ID_RAWVIDEO) {\n            enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;\n            enc->coded_frame->top_field_first  = in_picture->top_field_first;\n            pkt.data   = (uint8_t *)in_picture;\n            pkt.size   =  sizeof(AVPicture);\n            pkt.pts    = av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base);\n            pkt.flags |= AV_PKT_FLAG_KEY;\n            write_frame(s, &pkt, ost);\n        } else {\n            int got_packet;\n            AVFrame big_picture;\n            big_picture = *in_picture;\n            big_picture.interlaced_frame = in_picture->interlaced_frame;\n            if (ost->st->codec->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)) {\n                if (ost->top_field_first == -1)\n                    big_picture.top_field_first = in_picture->top_field_first;\n                else\n                    big_picture.top_field_first = !!ost->top_field_first;\n            }\n            big_picture.quality = quality;\n            if (!enc->me_threshold)\n                big_picture.pict_type = 0;\n            big_picture.pts = ost->sync_opts;\n            if (ost->forced_kf_index < ost->forced_kf_count &&\n                big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) {\n                big_picture.pict_type = AV_PICTURE_TYPE_I;\n                ost->forced_kf_index++;\n            }\n            ret = avcodec_encode_video2(enc, &pkt, &big_picture, &got_packet);\n            if (ret < 0) {\n                av_log(NULL, AV_LOG_FATAL, "Video encoding failed\\n");\n                exit_program(1);\n            }\n            if (got_packet) {\n                if (pkt.pts != AV_NOPTS_VALUE)\n                    pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);\n                if (pkt.dts != AV_NOPTS_VALUE)\n                    pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);\n                write_frame(s, &pkt, ost);\n                *frame_size = pkt.size;\n                video_size += pkt.size;\n                if (ost->logfile && enc->stats_out) {\n                    fprintf(ost->logfile, "%s", enc->stats_out);\n                }\n            }\n        }\n        ost->sync_opts++;\n        ost->frame_number++;\n    }\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    av_free(ref->video);\n    av_free(ref->audio);\n    av_free(ref);\n}']