libavformat/rtp_asf.c:108: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `av_close_input_stream`.

libavformat/rtp_asf.c:106:9: Call
104.             av_log(s, AV_LOG_ERROR,
105.                    "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");
106.         init_packetizer(&pb, buf, len);
             ^
107.         if (rt->asf_ctx) {
108.             av_close_input_stream(rt->asf_ctx);

libavformat/rtp_asf.c:87:5: Call
  85. static void init_packetizer(ByteIOContext *pb, uint8_t *buf, int len)
  86. {
  87.     init_put_byte(pb, buf, len, 0, NULL, packetizer_read, NULL, NULL);
          ^
  88. 
  89.     /* this "fills" the buffer with its current content */

libavformat/aviobuf.c:32:1: Parameter `opaque->flags`
    30. static void fill_buffer(ByteIOContext *s);
    31. 
    32. int init_put_byte(ByteIOContext *s,
        ^
    33.                   unsigned char *buffer,
    34.                   int buffer_size,

libavformat/aviobuf.c:45:5: Call
    43.     s->buf_ptr = buffer;
    44.     s->opaque = opaque;
    45.     url_resetbuf(s, write_flag ? URL_WRONLY : URL_RDONLY);
            ^
    46.     s->write_packet = write_packet;
    47.     s->read_packet = read_packet;

libavformat/aviobuf.c:582:1: Parameter `flags`
      580. }
      581. 
      582. int url_resetbuf(ByteIOContext *s, int flags)
           ^
      583. {
      584.     URLContext *h = s->opaque;

libavformat/rtp_asf.c:108:13: Call
106.         init_packetizer(&pb, buf, len);
107.         if (rt->asf_ctx) {
108.             av_close_input_stream(rt->asf_ctx);
                 ^
109.             rt->asf_ctx = NULL;
110.         }

libavformat/utils.c:2298:1: <LHS trace>
2296. }
2297. 
2298. void av_close_input_stream(AVFormatContext *s)
      ^
2299. {
2300.     int i;

libavformat/utils.c:2298:1: Parameter `s->nb_programs`
  2296. }
  2297. 
  2298. void av_close_input_stream(AVFormatContext *s)
        ^
  2299. {
  2300.     int i;

libavformat/utils.c:2322:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `av_close_input_stream` 
  2320.         av_free(st);
  2321.     }
  2322.     for(i=s->nb_programs-1; i>=0; i--) {
                ^
  2323. #if LIBAVFORMAT_VERSION_INT < (53<<16)
  2324.         av_freep(&s->programs[i]->provider_name);

void av_close_input_stream(AVFormatContext *s)
{
    int i;
    AVStream *st;
    if (s->iformat->read_close)
        s->iformat->read_close(s);
    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_metadata_free(&st->metadata);
        av_free(st->index_entries);
        av_free(st->codec->extradata);
        av_free(st->codec);
#if LIBAVFORMAT_VERSION_INT < (53<<16)
        av_free(st->filename);
#endif
        av_free(st->priv_data);
        av_free(st);
    }
    for(i=s->nb_programs-1; i>=0; i--) {
#if LIBAVFORMAT_VERSION_INT < (53<<16)
        av_freep(&s->programs[i]->provider_name);
        av_freep(&s->programs[i]->name);
#endif
        av_metadata_free(&s->programs[i]->metadata);
        av_freep(&s->programs[i]->stream_index);
        av_freep(&s->programs[i]);
    }
    av_freep(&s->programs);
    flush_packet_queue(s);
    av_freep(&s->priv_data);
    while(s->nb_chapters--) {
#if LIBAVFORMAT_VERSION_INT < (53<<16)
        av_free(s->chapters[s->nb_chapters]->title);
#endif
        av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
        av_free(s->chapters[s->nb_chapters]);
    }
    av_freep(&s->chapters);
    av_metadata_free(&s->metadata);
    av_free(s);
}
['void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)\n{\n    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {\n        ByteIOContext pb;\n        RTSPState *rt = s->priv_data;\n        int len = strlen(p) * 6 / 8;\n        char *buf = av_mallocz(len);\n        av_base64_decode(buf, p, len);\n        if (rtp_asf_fix_header(buf, len) < 0)\n            av_log(s, AV_LOG_ERROR,\n                   "Failed to fix invalid RTSP-MS/ASF min_pktsize\\n");\n        init_packetizer(&pb, buf, len);\n        if (rt->asf_ctx) {\n            av_close_input_stream(rt->asf_ctx);\n            rt->asf_ctx = NULL;\n        }\n        av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);\n        rt->asf_pb_pos = url_ftell(&pb);\n        av_free(buf);\n        rt->asf_ctx->pb = NULL;\n    }\n}', 'static void init_packetizer(ByteIOContext *pb, uint8_t *buf, int len)\n{\n    init_put_byte(pb, buf, len, 0, NULL, packetizer_read, NULL, NULL);\n    pb->pos     = len;\n    pb->buf_end = buf + len;\n}', 'int init_put_byte(ByteIOContext *s,\n                  unsigned char *buffer,\n                  int buffer_size,\n                  int write_flag,\n                  void *opaque,\n                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),\n                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),\n                  int64_t (*seek)(void *opaque, int64_t offset, int whence))\n{\n    s->buffer = buffer;\n    s->buffer_size = buffer_size;\n    s->buf_ptr = buffer;\n    s->opaque = opaque;\n    url_resetbuf(s, write_flag ? URL_WRONLY : URL_RDONLY);\n    s->write_packet = write_packet;\n    s->read_packet = read_packet;\n    s->seek = seek;\n    s->pos = 0;\n    s->must_flush = 0;\n    s->eof_reached = 0;\n    s->error = 0;\n    s->is_streamed = 0;\n    s->max_packet_size = 0;\n    s->update_checksum= NULL;\n    if(!read_packet && !write_flag){\n        s->pos = buffer_size;\n        s->buf_end = s->buffer + buffer_size;\n    }\n    s->read_pause = NULL;\n    s->read_seek  = NULL;\n    return 0;\n}', 'int url_resetbuf(ByteIOContext *s, int flags)\n{\n    URLContext *h = s->opaque;\n    if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR))\n        return AVERROR(EINVAL);\n    if (flags & URL_WRONLY) {\n        s->buf_end = s->buffer + s->buffer_size;\n        s->write_flag = 1;\n    } else {\n        s->buf_end = s->buffer;\n        s->write_flag = 0;\n    }\n    return 0;\n}', 'void av_close_input_stream(AVFormatContext *s)\n{\n    int i;\n    AVStream *st;\n    if (s->iformat->read_close)\n        s->iformat->read_close(s);\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_metadata_free(&st->metadata);\n        av_free(st->index_entries);\n        av_free(st->codec->extradata);\n        av_free(st->codec);\n#if LIBAVFORMAT_VERSION_INT < (53<<16)\n        av_free(st->filename);\n#endif\n        av_free(st->priv_data);\n        av_free(st);\n    }\n    for(i=s->nb_programs-1; i>=0; i--) {\n#if LIBAVFORMAT_VERSION_INT < (53<<16)\n        av_freep(&s->programs[i]->provider_name);\n        av_freep(&s->programs[i]->name);\n#endif\n        av_metadata_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    flush_packet_queue(s);\n    av_freep(&s->priv_data);\n    while(s->nb_chapters--) {\n#if LIBAVFORMAT_VERSION_INT < (53<<16)\n        av_free(s->chapters[s->nb_chapters]->title);\n#endif\n        av_metadata_free(&s->chapters[s->nb_chapters]->metadata);\n        av_free(s->chapters[s->nb_chapters]);\n    }\n    av_freep(&s->chapters);\n    av_metadata_free(&s->metadata);\n    av_free(s);\n}']