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

avconv.c:1879:17: Call
1877.                     ost->st->codec->sample_aspect_ratio = picref->video->pixel_aspect;
1878. 
1879.                 do_video_out(of->ctx, ost, filtered_frame, &frame_size,
                      ^
1880.                              same_quant ? ost->last_quality :
1881.                                           ost->st->codec->global_quality);

avconv.c:1744:13: Call
  1742.             pkt.flags |= AV_PKT_FLAG_KEY;
  1743. 
  1744.             write_frame(s, &pkt, ost);
                    ^
  1745.         } else {
  1746.             int got_packet;

avconv.c:1890:13: Call
1888.             }
1889. 
1890.             avfilter_unref_buffer(picref);
                  ^
1891.         }
1892.     }

libavfilter/avfilter.c:87:1: <LHS trace>
85. }
86. 
87. void avfilter_unref_buffer(AVFilterBufferRef *ref)
    ^
88. {
89.     if (!ref)

libavfilter/avfilter.c:87:1: Parameter `ref->buf->refcount`
  85. }
  86. 
  87. void avfilter_unref_buffer(AVFilterBufferRef *ref)
      ^
  88. {
  89.     if (!ref)

libavfilter/avfilter.c:91:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 
  89.     if (!ref)
  90.         return;
  91.     if (!(--ref->buf->refcount))
                ^
  92.         ref->buf->free(ref->buf);
  93.     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 int poll_filters(void)\n{\n    AVFilterBufferRef *picref;\n    AVFrame *filtered_frame = NULL;\n    int i, frame_size;\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 (av_buffersink_read(ost->filter->filter, &picref) >= 0) {\n            avfilter_copy_buf_props(filtered_frame, picref);\n            filtered_frame->pts = av_rescale_q(picref->pts,\n                                               ost->filter->filter->inputs[0]->time_base,\n                                               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    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}']