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

libavformat/rtpdec_asf.c:105:9: Call
103.         int len = strlen(p) * 6 / 8;
104.         char *buf = av_mallocz(len);
105.         av_base64_decode(buf, p, len);
             ^
106. 
107.         if (rtp_asf_fix_header(buf, len) < 0)

libavutil/base64.c:45:1: Parameter `out->strlen`
  43. };
  44. 
  45. int av_base64_decode(uint8_t *out, const char *in, int out_size)
      ^
  46. {
  47.     int i;

libavformat/rtpdec_asf.c:107:13: Call
105.         av_base64_decode(buf, p, len);
106. 
107.         if (rtp_asf_fix_header(buf, len) < 0)
                 ^
108.             av_log(s, AV_LOG_ERROR,
109.                    "Failed to fix invalid RTSP-MS/ASF min_pktsize\n");

libavformat/rtpdec_asf.c:45:1: Parameter `*buf`
  43.  * @return 0 on success, <0 on failure (currently -1).
  44.  */
  45. static int rtp_asf_fix_header(uint8_t *buf, int len)
      ^
  46. {
  47.     uint8_t *p = buf, *end = buf + len;

libavformat/rtpdec_asf.c:112:13: Call
110.         init_packetizer(&pb, buf, len);
111.         if (rt->asf_ctx) {
112.             avformat_close_input(&rt->asf_ctx);
                 ^
113.         }
114.         if (!(rt->asf_ctx = avformat_alloc_context()))

libavformat/utils.c:2639:1: Parameter `(*ps)->nb_programs`
  2637. }
  2638. 
  2639. void avformat_close_input(AVFormatContext **ps)
        ^
  2640. {
  2641.     AVFormatContext *s = *ps;

libavformat/utils.c:2654:5: Call
  2652.             s->iformat->read_close(s);
  2653. 
  2654.     avformat_free_context(s);
            ^
  2655. 
  2656.     *ps = NULL;

libavformat/utils.c:2595:1: <LHS trace>
2593. }
2594. 
2595. void avformat_free_context(AVFormatContext *s)
      ^
2596. {
2597.     int i;

libavformat/utils.c:2595:1: Parameter `s->nb_programs`
    2593. }
    2594. 
    2595. void avformat_free_context(AVFormatContext *s)
          ^
    2596. {
    2597.     int i;

libavformat/utils.c:2622:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_close_input` 
    2620.         av_free(st);
    2621.     }
    2622.     for (i = s->nb_programs - 1; i >= 0; i--) {
                   ^
    2623.         av_dict_free(&s->programs[i]->metadata);
    2624.         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);
        }
        if (st->attached_pic.data)
            av_free_packet(&st->attached_pic);
        av_dict_free(&st->metadata);
        av_freep(&st->probe_data.buf);
        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);
}
['int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)\n{\n    int ret = 0;\n    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {\n        AVIOContext pb;\n        RTSPState *rt = s->priv_data;\n        AVDictionary *opts = NULL;\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            avformat_close_input(&rt->asf_ctx);\n        }\n        if (!(rt->asf_ctx = avformat_alloc_context()))\n            return AVERROR(ENOMEM);\n        rt->asf_ctx->pb      = &pb;\n        av_dict_set(&opts, "no_resync_search", "1", 0);\n        ret = avformat_open_input(&rt->asf_ctx, "", &ff_asf_demuxer, &opts);\n        av_dict_free(&opts);\n        if (ret < 0)\n            return ret;\n        av_dict_copy(&s->metadata, rt->asf_ctx->metadata, 0);\n        rt->asf_pb_pos = avio_tell(&pb);\n        av_free(buf);\n        rt->asf_ctx->pb = NULL;\n    }\n    return ret;\n}', "int av_base64_decode(uint8_t *out, const char *in, int out_size)\n{\n    int i;\n    unsigned v = 0;\n    uint8_t *dst = out;\n    for (i = 0; in[i] && in[i] != '='; i++) {\n        unsigned int index= in[i]-43;\n        if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)\n            return -1;\n        v = (v << 6) + map2[index];\n        if (i & 3) {\n            if (dst - out < out_size) {\n                *dst++ = v >> (6 - 2 * (i & 3));\n            }\n        }\n    }\n    return dst - out;\n}", 'static int rtp_asf_fix_header(uint8_t *buf, int len)\n{\n    uint8_t *p = buf, *end = buf + len;\n    if (len < sizeof(ff_asf_guid) * 2 + 22 ||\n        memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {\n        return -1;\n    }\n    p += sizeof(ff_asf_guid) + 14;\n    do {\n        uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));\n        if (memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {\n            if (chunksize > end - p)\n                return -1;\n            p += chunksize;\n            continue;\n        }\n        p += 6 * 8 + 3 * 4 + sizeof(ff_asf_guid) * 2;\n        if (p + 8 <= end && AV_RL32(p) == AV_RL32(p + 4)) {\n            AV_WL32(p, 0);\n            return 0;\n        }\n        break;\n    } while (end - p >= sizeof(ff_asf_guid) + 8);\n    return -1;\n}', 'void avformat_close_input(AVFormatContext **ps)\n{\n    AVFormatContext *s = *ps;\n    AVIOContext *pb    = s->pb;\n    if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||\n        (s->flags & AVFMT_FLAG_CUSTOM_IO))\n        pb = NULL;\n    flush_packet_queue(s);\n    if (s->iformat)\n        if (s->iformat->read_close)\n            s->iformat->read_close(s);\n    avformat_free_context(s);\n    *ps = NULL;\n    avio_close(pb);\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        }\n        if (st->attached_pic.data)\n            av_free_packet(&st->attached_pic);\n        av_dict_free(&st->metadata);\n        av_freep(&st->probe_data.buf);\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}']