libavformat/rtsp.c:526: error: Null Dereference
  pointer `st` last assigned on line 511 could be null and is dereferenced at line 526, column 56.

libavformat/rtsp.c:508:1: start of procedure rtsp_open_transport_ctx()
506. }
507. 
508. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
     ^
509. {
510.     RTSPState *rt = s->priv_data;

libavformat/rtsp.c:510:5: 
508. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
509. {
510.     RTSPState *rt = s->priv_data;
         ^
511.     AVStream *st = NULL;
512. 

libavformat/rtsp.c:511:5: 
509. {
510.     RTSPState *rt = s->priv_data;
511.     AVStream *st = NULL;
         ^
512. 
513.     /* open the RTP context */

libavformat/rtsp.c:514:9: Taking false branch
512. 
513.     /* open the RTP context */
514.     if (rtsp_st->stream_index >= 0)
             ^
515.         st = s->streams[rtsp_st->stream_index];
516.     if (!st)

libavformat/rtsp.c:516:10: Taking true branch
514.     if (rtsp_st->stream_index >= 0)
515.         st = s->streams[rtsp_st->stream_index];
516.     if (!st)
              ^
517.         s->ctx_flags |= AVFMTCTX_NOHEADER;
518. 

libavformat/rtsp.c:517:9: 
515.         st = s->streams[rtsp_st->stream_index];
516.     if (!st)
517.         s->ctx_flags |= AVFMTCTX_NOHEADER;
             ^
518. 
519.     if (s->oformat && CONFIG_RTSP_MUXER) {

libavformat/rtsp.c:519:9: Taking false branch
517.         s->ctx_flags |= AVFMTCTX_NOHEADER;
518. 
519.     if (s->oformat && CONFIG_RTSP_MUXER) {
             ^
520.         rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
521.                                       rtsp_st->rtp_handle,

libavformat/rtsp.c:525:16: Taking true branch
523.         /* Ownership of rtp_handle is passed to the rtp mux context */
524.         rtsp_st->rtp_handle = NULL;
525.     } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
                    ^
526.         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
527.                                             rtsp_st->dynamic_protocol_context,

libavformat/rtsp.c:525:55: Taking true branch
523.         /* Ownership of rtp_handle is passed to the rtp mux context */
524.         rtsp_st->rtp_handle = NULL;
525.     } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
                                                           ^
526.         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
527.                                             rtsp_st->dynamic_protocol_context,

libavformat/rtsp.c:526:9: 
524.         rtsp_st->rtp_handle = NULL;
525.     } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
526.         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
             ^
527.                                             rtsp_st->dynamic_protocol_context,
528.                                             rtsp_st->dynamic_handler);
