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

libavformat/rtsp.c:522:1: start of procedure rtsp_open_transport_ctx()
520. }
521. 
522. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
     ^
523. {
524.     RTSPState *rt = s->priv_data;

libavformat/rtsp.c:524:5: 
522. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
523. {
524.     RTSPState *rt = s->priv_data;
         ^
525.     AVStream *st = NULL;
526. 

libavformat/rtsp.c:525:5: 
523. {
524.     RTSPState *rt = s->priv_data;
525.     AVStream *st = NULL;
         ^
526. 
527.     /* open the RTP context */

libavformat/rtsp.c:528:9: Taking false branch
526. 
527.     /* open the RTP context */
528.     if (rtsp_st->stream_index >= 0)
             ^
529.         st = s->streams[rtsp_st->stream_index];
530.     if (!st)

libavformat/rtsp.c:530:10: Taking true branch
528.     if (rtsp_st->stream_index >= 0)
529.         st = s->streams[rtsp_st->stream_index];
530.     if (!st)
              ^
531.         s->ctx_flags |= AVFMTCTX_NOHEADER;
532. 

libavformat/rtsp.c:531:9: 
529.         st = s->streams[rtsp_st->stream_index];
530.     if (!st)
531.         s->ctx_flags |= AVFMTCTX_NOHEADER;
             ^
532. 
533.     if (s->oformat && CONFIG_RTSP_MUXER) {

libavformat/rtsp.c:533:9: Taking false branch
531.         s->ctx_flags |= AVFMTCTX_NOHEADER;
532. 
533.     if (s->oformat && CONFIG_RTSP_MUXER) {
             ^
534.         rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
535.                                       rtsp_st->rtp_handle,

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

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

libavformat/rtsp.c:540:9: 
538.         rtsp_st->rtp_handle = NULL;
539.     } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
540.         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
             ^
541.                                             rtsp_st->dynamic_protocol_context,
542.                                             rtsp_st->dynamic_handler);
