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

avconv.c:2868:21: Unknown value from: strncmp
2866.         filename = "pipe:";
2867. 
2868.     using_stdin |= !strncmp(filename, "pipe:", 5) ||
                          ^
2869.                     !strcmp(filename, "/dev/stdin");
2870. 

avconv.c:2896:5: Assignment
2894.         av_dict_set(&format_opts, "pixel_format", av_get_pix_fmt_name(frame_pix_fmt), 0);
2895. 
2896.     ic->flags |= AVFMT_FLAG_NONBLOCK;
          ^
2897. 
2898.     /* open the input file with generic libav function */

avconv.c:2899:11: Call
2897. 
2898.     /* open the input file with generic libav function */
2899.     err = avformat_open_input(&ic, filename, file_iformat, &format_opts);
                ^
2900.     if (err < 0) {
2901.         print_error(filename, err);

libavformat/utils.c:596:1: Parameter `(*ps)->nb_programs`
  594. }
  595. 
  596. int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
       ^
  597. {
  598.     AVFormatContext *s = *ps;

libavformat/utils.c:666:5: Call
  664.     if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
  665.         avio_close(s->pb);
  666.     avformat_free_context(s);
           ^
  667.     *ps = NULL;
  668.     return ret;

libavformat/utils.c:2606:1: <LHS trace>
2604. }
2605. 
2606. void avformat_free_context(AVFormatContext *s)
      ^
2607. {
2608.     int i;

libavformat/utils.c:2606:1: Parameter `s->nb_programs`
    2604. }
    2605. 
    2606. void avformat_free_context(AVFormatContext *s)
          ^
    2607. {
    2608.     int i;

libavformat/utils.c:2631:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_open_input` 
    2629.         av_free(st);
    2630.     }
    2631.     for(i=s->nb_programs-1; i>=0; i--) {
                  ^
    2632.         av_dict_free(&s->programs[i]->metadata);
    2633.         av_freep(&s->programs[i]->stream_index);

void avformat_free_context(AVFormatContext *s)
{
    int i;
    AVStream *st;
    av_opt_free(s);
    if (s->iformat && s->iformat->priv_class && s->priv_data)
        av_opt_free(s->priv_data);
    for(i=0;i<s->nb_streams;i++) {
        st = s->streams[i];
        if (st->parser) {
            av_parser_close(st->parser);
            av_free_packet(&st->cur_pkt);
        }
        av_dict_free(&st->metadata);
        av_free(st->index_entries);
        av_free(st->codec->extradata);
        av_free(st->codec->subtitle_header);
        av_free(st->codec);
        av_free(st->priv_data);
        av_free(st->info);
        av_free(st);
    }
    for(i=s->nb_programs-1; i>=0; i--) {
        av_dict_free(&s->programs[i]->metadata);
        av_freep(&s->programs[i]->stream_index);
        av_freep(&s->programs[i]);
    }
    av_freep(&s->programs);
    av_freep(&s->priv_data);
    while(s->nb_chapters--) {
        av_dict_free(&s->chapters[s->nb_chapters]->metadata);
        av_free(s->chapters[s->nb_chapters]);
    }
    av_freep(&s->chapters);
    av_dict_free(&s->metadata);
    av_freep(&s->streams);
    av_free(s);
}
['static int opt_input_file(const char *opt, const char *filename)\n{\n    AVFormatContext *ic;\n    AVInputFormat *file_iformat = NULL;\n    int err, i, ret, rfps, rfps_base;\n    int64_t timestamp;\n    uint8_t buf[128];\n    AVDictionary **opts;\n    int orig_nb_streams;\n    if (last_asked_format) {\n        if (!(file_iformat = av_find_input_format(last_asked_format))) {\n            fprintf(stderr, "Unknown input format: \'%s\'\\n", last_asked_format);\n            exit_program(1);\n        }\n        last_asked_format = NULL;\n    }\n    if (!strcmp(filename, "-"))\n        filename = "pipe:";\n    using_stdin |= !strncmp(filename, "pipe:", 5) ||\n                    !strcmp(filename, "/dev/stdin");\n    ic = avformat_alloc_context();\n    if (!ic) {\n        print_error(filename, AVERROR(ENOMEM));\n        exit_program(1);\n    }\n    if (audio_sample_rate) {\n        snprintf(buf, sizeof(buf), "%d", audio_sample_rate);\n        av_dict_set(&format_opts, "sample_rate", buf, 0);\n    }\n    if (audio_channels) {\n        snprintf(buf, sizeof(buf), "%d", audio_channels);\n        av_dict_set(&format_opts, "channels", buf, 0);\n    }\n    if (frame_rate.num) {\n        snprintf(buf, sizeof(buf), "%d/%d", frame_rate.num, frame_rate.den);\n        av_dict_set(&format_opts, "framerate", buf, 0);\n    }\n    if (frame_width && frame_height) {\n        snprintf(buf, sizeof(buf), "%dx%d", frame_width, frame_height);\n        av_dict_set(&format_opts, "video_size", buf, 0);\n    }\n    if (frame_pix_fmt != PIX_FMT_NONE)\n        av_dict_set(&format_opts, "pixel_format", av_get_pix_fmt_name(frame_pix_fmt), 0);\n    ic->flags |= AVFMT_FLAG_NONBLOCK;\n    err = avformat_open_input(&ic, filename, file_iformat, &format_opts);\n    if (err < 0) {\n        print_error(filename, err);\n        exit_program(1);\n    }\n    assert_avoptions(format_opts);\n    if(opt_programid) {\n        int i, j;\n        int found=0;\n        for(i=0; i<ic->nb_streams; i++){\n            ic->streams[i]->discard= AVDISCARD_ALL;\n        }\n        for(i=0; i<ic->nb_programs; i++){\n            AVProgram *p= ic->programs[i];\n            if(p->id != opt_programid){\n                p->discard = AVDISCARD_ALL;\n            }else{\n                found=1;\n                for(j=0; j<p->nb_stream_indexes; j++){\n                    ic->streams[p->stream_index[j]]->discard= AVDISCARD_DEFAULT;\n                }\n            }\n        }\n        if(!found){\n            fprintf(stderr, "Specified program id not found\\n");\n            exit_program(1);\n        }\n        opt_programid=0;\n    }\n    for (i = 0; i < ic->nb_streams; i++)\n        choose_codec(ic, ic->streams[i], ic->streams[i]->codec->codec_type, codec_names);\n    opts = setup_find_stream_info_opts(ic, codec_opts);\n    orig_nb_streams = ic->nb_streams;\n    ret = avformat_find_stream_info(ic, opts);\n    if (ret < 0 && verbose >= 0) {\n        fprintf(stderr, "%s: could not find codec parameters\\n", filename);\n        av_close_input_file(ic);\n        exit_program(1);\n    }\n    timestamp = start_time;\n    if (ic->start_time != AV_NOPTS_VALUE)\n        timestamp += ic->start_time;\n    if (start_time != 0) {\n        ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD);\n        if (ret < 0) {\n            fprintf(stderr, "%s: could not seek to position %0.3f\\n",\n                    filename, (double)timestamp / AV_TIME_BASE);\n        }\n        start_time = 0;\n    }\n    for(i=0;i<ic->nb_streams;i++) {\n        AVStream *st = ic->streams[i];\n        AVCodecContext *dec = st->codec;\n        InputStream *ist;\n        dec->thread_count = thread_count;\n        input_streams = grow_array(input_streams, sizeof(*input_streams), &nb_input_streams, nb_input_streams + 1);\n        ist = &input_streams[nb_input_streams - 1];\n        ist->st = st;\n        ist->file_index = nb_input_files;\n        ist->discard = 1;\n        ist->opts = filter_codec_opts(codec_opts, ist->st->codec->codec_id, ic, st);\n        if (i < nb_ts_scale)\n            ist->ts_scale = ts_scale[i];\n        ist->dec = choose_codec(ic, st, dec->codec_type, codec_names);\n        switch (dec->codec_type) {\n        case AVMEDIA_TYPE_AUDIO:\n            if(audio_disable)\n                st->discard= AVDISCARD_ALL;\n            break;\n        case AVMEDIA_TYPE_VIDEO:\n            rfps      = ic->streams[i]->r_frame_rate.num;\n            rfps_base = ic->streams[i]->r_frame_rate.den;\n            if (dec->lowres) {\n                dec->flags |= CODEC_FLAG_EMU_EDGE;\n                dec->height >>= dec->lowres;\n                dec->width  >>= dec->lowres;\n            }\n            if(me_threshold)\n                dec->debug |= FF_DEBUG_MV;\n            if (dec->time_base.den != rfps*dec->ticks_per_frame || dec->time_base.num != rfps_base) {\n                if (verbose >= 0)\n                    fprintf(stderr,"\\nSeems stream %d codec frame rate differs from container frame rate: %2.2f (%d/%d) -> %2.2f (%d/%d)\\n",\n                            i, (float)dec->time_base.den / dec->time_base.num, dec->time_base.den, dec->time_base.num,\n                    (float)rfps / rfps_base, rfps, rfps_base);\n            }\n            if(video_disable)\n                st->discard= AVDISCARD_ALL;\n            else if(video_discard)\n                st->discard= video_discard;\n            break;\n        case AVMEDIA_TYPE_DATA:\n            break;\n        case AVMEDIA_TYPE_SUBTITLE:\n            if(subtitle_disable)\n                st->discard = AVDISCARD_ALL;\n            break;\n        case AVMEDIA_TYPE_ATTACHMENT:\n        case AVMEDIA_TYPE_UNKNOWN:\n            break;\n        default:\n            abort();\n        }\n    }\n    if (verbose >= 0)\n        av_dump_format(ic, nb_input_files, filename, 0);\n    input_files = grow_array(input_files, sizeof(*input_files), &nb_input_files, nb_input_files + 1);\n    input_files[nb_input_files - 1].ctx        = ic;\n    input_files[nb_input_files - 1].ist_index  = nb_input_streams - ic->nb_streams;\n    input_files[nb_input_files - 1].ts_offset  = input_ts_offset - (copy_ts ? 0 : timestamp);\n    frame_rate    = (AVRational){0, 0};\n    frame_pix_fmt = PIX_FMT_NONE;\n    frame_height = 0;\n    frame_width  = 0;\n    audio_sample_rate = 0;\n    audio_channels    = 0;\n    audio_sample_fmt  = AV_SAMPLE_FMT_NONE;\n    av_freep(&ts_scale);\n    nb_ts_scale = 0;\n    for (i = 0; i < orig_nb_streams; i++)\n        av_dict_free(&opts[i]);\n    av_freep(&opts);\n    av_dict_free(&codec_names);\n    uninit_opts();\n    init_opts();\n    return 0;\n}', 'int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)\n{\n    AVFormatContext *s = *ps;\n    int ret = 0;\n    AVFormatParameters ap = { { 0 } };\n    AVDictionary *tmp = NULL;\n    if (!s && !(s = avformat_alloc_context()))\n        return AVERROR(ENOMEM);\n    if (fmt)\n        s->iformat = fmt;\n    if (options)\n        av_dict_copy(&tmp, *options, 0);\n    if ((ret = av_opt_set_dict(s, &tmp)) < 0)\n        goto fail;\n    if ((ret = init_input(s, filename)) < 0)\n        goto fail;\n    if (s->iformat->flags & AVFMT_NEEDNUMBER) {\n        if (!av_filename_number_test(filename)) {\n            ret = AVERROR(EINVAL);\n            goto fail;\n        }\n    }\n    s->duration = s->start_time = AV_NOPTS_VALUE;\n    av_strlcpy(s->filename, filename, sizeof(s->filename));\n    if (s->iformat->priv_data_size > 0) {\n        if (!(s->priv_data = av_mallocz(s->iformat->priv_data_size))) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        if (s->iformat->priv_class) {\n            *(const AVClass**)s->priv_data = s->iformat->priv_class;\n            av_opt_set_defaults(s->priv_data);\n            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)\n                goto fail;\n        }\n    }\n    if (s->pb)\n        ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC);\n    if (s->iformat->read_header)\n        if ((ret = s->iformat->read_header(s, &ap)) < 0)\n            goto fail;\n    if (s->pb && !s->data_offset)\n        s->data_offset = avio_tell(s->pb);\n    s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;\n    if (options) {\n        av_dict_free(options);\n        *options = tmp;\n    }\n    *ps = s;\n    return 0;\nfail:\n    av_dict_free(&tmp);\n    if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))\n        avio_close(s->pb);\n    avformat_free_context(s);\n    *ps = NULL;\n    return ret;\n}', 'void avformat_free_context(AVFormatContext *s)\n{\n    int i;\n    AVStream *st;\n    av_opt_free(s);\n    if (s->iformat && s->iformat->priv_class && s->priv_data)\n        av_opt_free(s->priv_data);\n    for(i=0;i<s->nb_streams;i++) {\n        st = s->streams[i];\n        if (st->parser) {\n            av_parser_close(st->parser);\n            av_free_packet(&st->cur_pkt);\n        }\n        av_dict_free(&st->metadata);\n        av_free(st->index_entries);\n        av_free(st->codec->extradata);\n        av_free(st->codec->subtitle_header);\n        av_free(st->codec);\n        av_free(st->priv_data);\n        av_free(st->info);\n        av_free(st);\n    }\n    for(i=s->nb_programs-1; i>=0; i--) {\n        av_dict_free(&s->programs[i]->metadata);\n        av_freep(&s->programs[i]->stream_index);\n        av_freep(&s->programs[i]);\n    }\n    av_freep(&s->programs);\n    av_freep(&s->priv_data);\n    while(s->nb_chapters--) {\n        av_dict_free(&s->chapters[s->nb_chapters]->metadata);\n        av_free(s->chapters[s->nb_chapters]);\n    }\n    av_freep(&s->chapters);\n    av_dict_free(&s->metadata);\n    av_freep(&s->streams);\n    av_free(s);\n}']