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

ffserver.c:2142:29: Unknown value from: strtol
2140.                 return ret;
2141.         } else if (av_find_info_tag(buf, sizeof(buf), "buffer", info)) {
2142.             int prebuffer = strtol(buf, 0, 10);
                                  ^
2143.             stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
2144.         } else

ffserver.c:2160:16: Call
2158. 
2159.     /* open stream */
2160.     if ((ret = avformat_open_input(&s, input_filename, c->stream->ifmt, &c->stream->in_opts)) < 0) {
                     ^
2161.         http_log("could not open %s: %d\n", input_filename, ret);
2162.         return -1;

libavformat/utils.c:585:1: Parameter `(*ps)->nb_programs`
  583. }
  584. 
  585. int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
       ^
  586. {
  587.     AVFormatContext *s = *ps;

libavformat/utils.c:655:5: Call
  653.     if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
  654.         avio_close(s->pb);
  655.     avformat_free_context(s);
           ^
  656.     *ps = NULL;
  657.     return ret;

libavformat/utils.c:2584:1: <LHS trace>
2582. }
2583. 
2584. void avformat_free_context(AVFormatContext *s)
      ^
2585. {
2586.     int i;

libavformat/utils.c:2584:1: Parameter `s->nb_programs`
    2582. }
    2583. 
    2584. void avformat_free_context(AVFormatContext *s)
          ^
    2585. {
    2586.     int i;

libavformat/utils.c:2609:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_open_input` 
    2607.         av_free(st);
    2608.     }
    2609.     for(i=s->nb_programs-1; i>=0; i--) {
                  ^
    2610.         av_dict_free(&s->programs[i]->metadata);
    2611.         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 open_input_stream(HTTPContext *c, const char *info)\n{\n    char buf[128];\n    char input_filename[1024];\n    AVFormatContext *s = NULL;\n    int buf_size, i, ret;\n    int64_t stream_pos;\n    if (c->stream->feed) {\n        strcpy(input_filename, c->stream->feed->feed_filename);\n        buf_size = FFM_PACKET_SIZE;\n        if (av_find_info_tag(buf, sizeof(buf), "date", info)) {\n            if ((ret = av_parse_time(&stream_pos, buf, 0)) < 0)\n                return ret;\n        } else if (av_find_info_tag(buf, sizeof(buf), "buffer", info)) {\n            int prebuffer = strtol(buf, 0, 10);\n            stream_pos = av_gettime() - prebuffer * (int64_t)1000000;\n        } else\n            stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;\n    } else {\n        strcpy(input_filename, c->stream->feed_filename);\n        buf_size = 0;\n        if (av_find_info_tag(buf, sizeof(buf), "date", info)) {\n            if ((ret = av_parse_time(&stream_pos, buf, 1)) < 0)\n                return ret;\n        } else\n            stream_pos = 0;\n    }\n    if (input_filename[0] == \'\\0\')\n        return -1;\n    if ((ret = avformat_open_input(&s, input_filename, c->stream->ifmt, &c->stream->in_opts)) < 0) {\n        http_log("could not open %s: %d\\n", input_filename, ret);\n        return -1;\n    }\n    s->flags |= AVFMT_FLAG_GENPTS;\n    c->fmt_in = s;\n    if (strcmp(s->iformat->name, "ffm") && av_find_stream_info(c->fmt_in) < 0) {\n        http_log("Could not find stream info \'%s\'\\n", input_filename);\n        av_close_input_file(s);\n        return -1;\n    }\n    for(i=0;i<s->nb_streams;i++)\n        open_parser(s, i);\n    c->pts_stream_index = 0;\n    for(i=0;i<c->stream->nb_streams;i++) {\n        if (c->pts_stream_index == 0 &&\n            c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {\n            c->pts_stream_index = i;\n        }\n    }\n    if (c->fmt_in->iformat->read_seek)\n        av_seek_frame(c->fmt_in, -1, stream_pos, 0);\n    c->start_time = cur_time;\n    c->first_pts = AV_NOPTS_VALUE;\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}']