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

libavformat/rtsp.c:894:1: start of procedure rtsp_open_transport_ctx()
892. }
893. 
894. static int
     ^
895. rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
896. {

libavformat/rtsp.c:897:5: 
895. rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
896. {
897.     RTSPState *rt = s->priv_data;
         ^
898.     AVStream *st = NULL;
899. 

libavformat/rtsp.c:898:5: 
896. {
897.     RTSPState *rt = s->priv_data;
898.     AVStream *st = NULL;
         ^
899. 
900.     /* open the RTP context */

libavformat/rtsp.c:901:9: Taking false branch
899. 
900.     /* open the RTP context */
901.     if (rtsp_st->stream_index >= 0)
             ^
902.         st = s->streams[rtsp_st->stream_index];
903.     if (!st)

libavformat/rtsp.c:903:10: Taking true branch
901.     if (rtsp_st->stream_index >= 0)
902.         st = s->streams[rtsp_st->stream_index];
903.     if (!st)
              ^
904.         s->ctx_flags |= AVFMTCTX_NOHEADER;
905. 

libavformat/rtsp.c:904:9: 
902.         st = s->streams[rtsp_st->stream_index];
903.     if (!st)
904.         s->ctx_flags |= AVFMTCTX_NOHEADER;
             ^
905. 
906.     if (rt->transport == RTSP_TRANSPORT_RDT)

libavformat/rtsp.c:906:9: Taking true branch
904.         s->ctx_flags |= AVFMTCTX_NOHEADER;
905. 
906.     if (rt->transport == RTSP_TRANSPORT_RDT)
             ^
907.         rtsp_st->tx_ctx = ff_rdt_parse_open(s, st->index,
908.                                             rtsp_st->dynamic_protocol_context,

libavformat/rtsp.c:907:9: 
905. 
906.     if (rt->transport == RTSP_TRANSPORT_RDT)
907.         rtsp_st->tx_ctx = ff_rdt_parse_open(s, st->index,
             ^
908.                                             rtsp_st->dynamic_protocol_context,
909.                                             rtsp_st->dynamic_handler);

static int
rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
{
    RTSPState *rt = s->priv_data;
    AVStream *st = NULL;
    if (rtsp_st->stream_index >= 0)
        st = s->streams[rtsp_st->stream_index];
    if (!st)
        s->ctx_flags |= AVFMTCTX_NOHEADER;
    if (rt->transport == RTSP_TRANSPORT_RDT)
        rtsp_st->tx_ctx = ff_rdt_parse_open(s, st->index,
                                            rtsp_st->dynamic_protocol_context,
                                            rtsp_st->dynamic_handler);
    else
        rtsp_st->tx_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle,
                                         rtsp_st->sdp_payload_type,
                                         &rtsp_st->rtp_payload_data);
    if (!rtsp_st->tx_ctx) {
         return AVERROR(ENOMEM);
    } else if (rt->transport != RTSP_TRANSPORT_RDT) {
        if(rtsp_st->dynamic_handler) {
            rtp_parse_set_dynamic_protocol(rtsp_st->tx_ctx,
                                           rtsp_st->dynamic_protocol_context,
                                           rtsp_st->dynamic_handler);
        }
    }
    return 0;
}
['static int\nrtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)\n{\n    RTSPState *rt = s->priv_data;\n    AVStream *st = NULL;\n    if (rtsp_st->stream_index >= 0)\n        st = s->streams[rtsp_st->stream_index];\n    if (!st)\n        s->ctx_flags |= AVFMTCTX_NOHEADER;\n    if (rt->transport == RTSP_TRANSPORT_RDT)\n        rtsp_st->tx_ctx = ff_rdt_parse_open(s, st->index,\n                                            rtsp_st->dynamic_protocol_context,\n                                            rtsp_st->dynamic_handler);\n    else\n        rtsp_st->tx_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle,\n                                         rtsp_st->sdp_payload_type,\n                                         &rtsp_st->rtp_payload_data);\n    if (!rtsp_st->tx_ctx) {\n         return AVERROR(ENOMEM);\n    } else if (rt->transport != RTSP_TRANSPORT_RDT) {\n        if(rtsp_st->dynamic_handler) {\n            rtp_parse_set_dynamic_protocol(rtsp_st->tx_ctx,\n                                           rtsp_st->dynamic_protocol_context,\n                                           rtsp_st->dynamic_handler);\n        }\n    }\n    return 0;\n}']