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

libavformat/rtsp.c:540:1: start of procedure rtsp_open_transport_ctx()
538. }
539. 
540. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
     ^
541. {
542.     RTSPState *rt = s->priv_data;

libavformat/rtsp.c:542:5: 
540. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
541. {
542.     RTSPState *rt = s->priv_data;
         ^
543.     AVStream *st = NULL;
544. 

libavformat/rtsp.c:543:5: 
541. {
542.     RTSPState *rt = s->priv_data;
543.     AVStream *st = NULL;
         ^
544. 
545.     /* open the RTP context */

libavformat/rtsp.c:546:9: Taking false branch
544. 
545.     /* open the RTP context */
546.     if (rtsp_st->stream_index >= 0)
             ^
547.         st = s->streams[rtsp_st->stream_index];
548.     if (!st)

libavformat/rtsp.c:548:10: Taking true branch
546.     if (rtsp_st->stream_index >= 0)
547.         st = s->streams[rtsp_st->stream_index];
548.     if (!st)
              ^
549.         s->ctx_flags |= AVFMTCTX_NOHEADER;
550. 

libavformat/rtsp.c:549:9: 
547.         st = s->streams[rtsp_st->stream_index];
548.     if (!st)
549.         s->ctx_flags |= AVFMTCTX_NOHEADER;
             ^
550. 
551.     if (s->oformat && CONFIG_RTSP_MUXER) {

libavformat/rtsp.c:551:9: Taking false branch
549.         s->ctx_flags |= AVFMTCTX_NOHEADER;
550. 
551.     if (s->oformat && CONFIG_RTSP_MUXER) {
             ^
552.         rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
553.                                       rtsp_st->rtp_handle,

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

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

libavformat/rtsp.c:558:9: 
556.         rtsp_st->rtp_handle = NULL;
557.     } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
558.         rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
             ^
559.                                             rtsp_st->dynamic_protocol_context,
560.                                             rtsp_st->dynamic_handler);
