libavformat/rtsp.c:605: error: Integer Overflow L1
  ([-oo, 0] - 1):unsigned32 by call to `av_close_input_stream`.

libavformat/rtsp.c:592:21: Call
590.                     av_free(rtpctx);
591.                 } else if (rt->transport == RTSP_TRANSPORT_RDT)
592.                     ff_rdt_parse_close(rtsp_st->transport_priv);
                         ^
593.                 else
594.                     rtp_parse_close(rtsp_st->transport_priv);

libavformat/rdt.c:82:9: Assignment
  80. 
  81.     for (i = 1; i < s->n_streams; i++)
  82.         s->streams[i]->priv_data = NULL;
              ^
  83. 
  84.     av_free(s);

libavformat/rtsp.c:605:9: Call
603.     av_free(rt->rtsp_streams);
604.     if (rt->asf_ctx) {
605.         av_close_input_stream (rt->asf_ctx);
             ^
606.         rt->asf_ctx = NULL;
607.     }

libavformat/utils.c:2348:1: <LHS trace>
2346. }
2347. 
2348. void av_close_input_stream(AVFormatContext *s)
      ^
2349. {
2350.     int i;

libavformat/utils.c:2348:1: Parameter `s->nb_chapters`
  2346. }
  2347. 
  2348. void av_close_input_stream(AVFormatContext *s)
        ^
  2349. {
  2350.     int i;

libavformat/utils.c:2384:11: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `av_close_input_stream` 
  2382.     flush_packet_queue(s);
  2383.     av_freep(&s->priv_data);
  2384.     while(s->nb_chapters--) {
                  ^
  2385. #if LIBAVFORMAT_VERSION_INT < (53<<16)
  2386.         av_free(s->chapters[s->nb_chapters]->title);

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 rtsp_close_streams(AVFormatContext *s)\n{\n    RTSPState *rt = s->priv_data;\n    int i;\n    RTSPStream *rtsp_st;\n    for (i = 0; i < rt->nb_rtsp_streams; i++) {\n        rtsp_st = rt->rtsp_streams[i];\n        if (rtsp_st) {\n            if (rtsp_st->transport_priv) {\n                if (s->oformat) {\n                    AVFormatContext *rtpctx = rtsp_st->transport_priv;\n                    av_write_trailer(rtpctx);\n                    url_fclose(rtpctx->pb);\n                    av_free(rtpctx->streams[0]);\n                    av_free(rtpctx);\n                } else if (rt->transport == RTSP_TRANSPORT_RDT)\n                    ff_rdt_parse_close(rtsp_st->transport_priv);\n                else\n                    rtp_parse_close(rtsp_st->transport_priv);\n            }\n            if (rtsp_st->rtp_handle)\n                url_close(rtsp_st->rtp_handle);\n            if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)\n                rtsp_st->dynamic_handler->close(\n                    rtsp_st->dynamic_protocol_context);\n        }\n    }\n    av_free(rt->rtsp_streams);\n    if (rt->asf_ctx) {\n        av_close_input_stream (rt->asf_ctx);\n        rt->asf_ctx = NULL;\n    }\n    av_freep(&rt->auth_b64);\n}', 'void\nff_rdt_parse_close(RDTDemuxContext *s)\n{\n    int i;\n    for (i = 1; i < s->n_streams; i++)\n        s->streams[i]->priv_data = NULL;\n    av_free(s);\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}']