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

avconv.c:2009:17: Call
2007.                          same_quant ? quality : ost->st->codec->global_quality);
2008.             if (vstats_filename && frame_size)
2009.                 do_video_stats(output_files[ost->file_index].ctx, ost, frame_size);
                      ^
2010. #if CONFIG_AVFILTER
2011.             frame_available = ost->output_video_filter && avfilter_poll_frame(ost->output_video_filter->inputs[0]);

avconv.c:2013:17: Call
2011.             frame_available = ost->output_video_filter && avfilter_poll_frame(ost->output_video_filter->inputs[0]);
2012.             if (ost->picref)
2013.                 avfilter_unref_buffer(ost->picref);
                      ^
2014.         }
2015. #endif

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 transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_t *pkt_pts)\n{\n    AVFrame *decoded_frame, *filtered_frame = NULL;\n    void *buffer_to_free = NULL;\n    int i, ret = 0;\n    float quality;\n#if CONFIG_AVFILTER\n    int frame_available = 1;\n#endif\n    if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame()))\n        return AVERROR(ENOMEM);\n    else\n        avcodec_get_frame_defaults(ist->decoded_frame);\n    decoded_frame = ist->decoded_frame;\n    pkt->pts  = *pkt_pts;\n    pkt->dts  = ist->pts;\n    *pkt_pts  = AV_NOPTS_VALUE;\n    ret = avcodec_decode_video2(ist->st->codec,\n                                decoded_frame, got_output, pkt);\n    if (ret < 0)\n        return ret;\n    quality = same_quant ? decoded_frame->quality : 0;\n    if (!*got_output) {\n        return ret;\n    }\n    ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, decoded_frame->pkt_pts,\n                                                 decoded_frame->pkt_dts);\n    if (pkt->duration)\n        ist->next_pts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);\n    else if (ist->st->codec->time_base.num != 0) {\n        int ticks      = ist->st->parser ? ist->st->parser->repeat_pict + 1 :\n                                           ist->st->codec->ticks_per_frame;\n        ist->next_pts += ((int64_t)AV_TIME_BASE *\n                          ist->st->codec->time_base.num * ticks) /\n                          ist->st->codec->time_base.den;\n    }\n    pkt->size = 0;\n    pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);\n    rate_emu_sleep(ist);\n    for (i = 0; i < nb_output_streams; i++) {\n        OutputStream *ost = &output_streams[i];\n        int frame_size, resample_changed;\n        if (!check_output_constraints(ist, ost) || !ost->encoding_needed)\n            continue;\n#if CONFIG_AVFILTER\n        resample_changed = ost->resample_width   != decoded_frame->width  ||\n                           ost->resample_height  != decoded_frame->height ||\n                           ost->resample_pix_fmt != decoded_frame->format;\n        if (resample_changed) {\n            av_log(NULL, AV_LOG_INFO,\n                    "Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\\n",\n                    ist->file_index, ist->st->index,\n                    ost->resample_width,  ost->resample_height,  av_get_pix_fmt_name(ost->resample_pix_fmt),\n                    decoded_frame->width, decoded_frame->height, av_get_pix_fmt_name(decoded_frame->format));\n            avfilter_graph_free(&ost->graph);\n            if (configure_video_filters(ist, ost)) {\n                av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\\n");\n                exit_program(1);\n            }\n            ost->resample_width   = decoded_frame->width;\n            ost->resample_height  = decoded_frame->height;\n            ost->resample_pix_fmt = decoded_frame->format;\n        }\n        if (ist->st->sample_aspect_ratio.num)\n            decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio;\n        if (ist->st->codec->codec->capabilities & CODEC_CAP_DR1) {\n            FrameBuffer      *buf = decoded_frame->opaque;\n            AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(\n                                        decoded_frame->data, decoded_frame->linesize,\n                                        AV_PERM_READ | AV_PERM_PRESERVE,\n                                        ist->st->codec->width, ist->st->codec->height,\n                                        ist->st->codec->pix_fmt);\n            avfilter_copy_frame_props(fb, decoded_frame);\n            fb->pts                 = ist->pts;\n            fb->buf->priv           = buf;\n            fb->buf->free           = filter_release_buffer;\n            buf->refcount++;\n            av_buffersrc_buffer(ost->input_video_filter, fb);\n        } else\n            av_vsrc_buffer_add_frame(ost->input_video_filter, decoded_frame,\n                                     ist->pts, decoded_frame->sample_aspect_ratio);\n        if (!ist->filtered_frame && !(ist->filtered_frame = avcodec_alloc_frame())) {\n            av_free(buffer_to_free);\n            return AVERROR(ENOMEM);\n        } else\n            avcodec_get_frame_defaults(ist->filtered_frame);\n        filtered_frame = ist->filtered_frame;\n        frame_available = avfilter_poll_frame(ost->output_video_filter->inputs[0]);\n        while (frame_available) {\n            AVRational ist_pts_tb;\n            if (ost->output_video_filter)\n                get_filtered_video_frame(ost->output_video_filter, filtered_frame, &ost->picref, &ist_pts_tb);\n            if (ost->picref)\n                ist->pts = av_rescale_q(ost->picref->pts, ist_pts_tb, AV_TIME_BASE_Q);\n            if (ost->picref->video && !ost->frame_aspect_ratio)\n                ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect;\n#else\n            filtered_frame = decoded_frame;\n#endif\n            do_video_out(output_files[ost->file_index].ctx, ost, ist, filtered_frame, &frame_size,\n                         same_quant ? quality : ost->st->codec->global_quality);\n            if (vstats_filename && frame_size)\n                do_video_stats(output_files[ost->file_index].ctx, ost, frame_size);\n#if CONFIG_AVFILTER\n            frame_available = ost->output_video_filter && avfilter_poll_frame(ost->output_video_filter->inputs[0]);\n            if (ost->picref)\n                avfilter_unref_buffer(ost->picref);\n        }\n#endif\n    }\n    av_free(buffer_to_free);\n    return ret;\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}']