libavformat/rtspdec.c:134: error: Null Dereference
  pointer `null` is dereferenced by call to `rtsp_send_reply()` at line 134, column 9.

libavformat/rtspdec.c:122:1: start of procedure check_sessionid()
120. }
121. 
122. static inline int check_sessionid(AVFormatContext *s,
     ^
123.                                   RTSPMessageHeader *request)
124. {

libavformat/rtspdec.c:125:5: 
123.                                   RTSPMessageHeader *request)
124. {
125.     RTSPState *rt = s->priv_data;
         ^
126.     unsigned char *session_id = rt->session_id;
127.     if (!session_id[0]) {

libavformat/rtspdec.c:126:5: 
124. {
125.     RTSPState *rt = s->priv_data;
126.     unsigned char *session_id = rt->session_id;
         ^
127.     if (!session_id[0]) {
128.         av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\n");

libavformat/rtspdec.c:127:10: Taking false branch
125.     RTSPState *rt = s->priv_data;
126.     unsigned char *session_id = rt->session_id;
127.     if (!session_id[0]) {
              ^
128.         av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\n");
129.         return 0;

libavformat/rtspdec.c:131:9: Taking true branch
129.         return 0;
130.     }
131.     if (strcmp(session_id, request->session_id)) {
             ^
132.         av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
133.                request->session_id);

libavformat/rtspdec.c:132:9: Skipping av_log(): empty list of specs
130.     }
131.     if (strcmp(session_id, request->session_id)) {
132.         av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
             ^
133.                request->session_id);
134.         rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);

libavformat/rtspdec.c:134:9: 
132.         av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
133.                request->session_id);
134.         rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);
             ^
135.         return AVERROR_STREAM_NOT_FOUND;
136.     }

libavformat/rtspdec.c:95:1: start of procedure rtsp_send_reply()
  93. }
  94. 
  95. static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,
      ^
  96.                            const char *extracontent, uint16_t seq)
  97. {

libavformat/rtspdec.c:98:5: 
   96.                            const char *extracontent, uint16_t seq)
   97. {
   98.     RTSPState *rt = s->priv_data;
           ^
   99.     char message[4096];
  100.     int index = 0;

libavformat/rtspdec.c:100:5: 
   98.     RTSPState *rt = s->priv_data;
   99.     char message[4096];
  100.     int index = 0;
           ^
  101.     while (status_messages[index].code) {
  102.         if (status_messages[index].code == code) {

libavformat/rtspdec.c:101:12: Loop condition is true. Entering loop body
   99.     char message[4096];
  100.     int index = 0;
  101.     while (status_messages[index].code) {
                  ^
  102.         if (status_messages[index].code == code) {
  103.             snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",

libavformat/rtspdec.c:102:13: Taking false branch
  100.     int index = 0;
  101.     while (status_messages[index].code) {
  102.         if (status_messages[index].code == code) {
                   ^
  103.             snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",
  104.                      code, status_messages[index].message);

libavformat/rtspdec.c:107:9: 
  105.             break;
  106.         }
  107.         index++;
               ^
  108.     }
  109.     if (!status_messages[index].code)

libavformat/rtspdec.c:101:12: Loop condition is true. Entering loop body
   99.     char message[4096];
  100.     int index = 0;
  101.     while (status_messages[index].code) {
                  ^
  102.         if (status_messages[index].code == code) {
  103.             snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",

libavformat/rtspdec.c:102:13: Taking false branch
  100.     int index = 0;
  101.     while (status_messages[index].code) {
  102.         if (status_messages[index].code == code) {
                   ^
  103.             snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",
  104.                      code, status_messages[index].message);

libavformat/rtspdec.c:107:9: 
  105.             break;
  106.         }
  107.         index++;
               ^
  108.     }
  109.     if (!status_messages[index].code)

libavformat/rtspdec.c:101:12: Loop condition is false. Leaving loop
   99.     char message[4096];
  100.     int index = 0;
  101.     while (status_messages[index].code) {
                  ^
  102.         if (status_messages[index].code == code) {
  103.             snprintf(message, sizeof(message), "RTSP/1.0 %d %s\r\n",

libavformat/rtspdec.c:109:10: Taking true branch
  107.         index++;
  108.     }
  109.     if (!status_messages[index].code)
                ^
  110.         return AVERROR(EINVAL);
  111.     av_strlcatf(message, sizeof(message), "CSeq: %d\r\n", seq);

libavformat/rtspdec.c:110:9: 
  108.     }
  109.     if (!status_messages[index].code)
  110.         return AVERROR(EINVAL);
               ^
  111.     av_strlcatf(message, sizeof(message), "CSeq: %d\r\n", seq);
  112.     av_strlcatf(message, sizeof(message), "Server: %s\r\n", LIBAVFORMAT_IDENT);

libavformat/rtspdec.c:120:1: return from a call to rtsp_send_reply
  118. 
  119.     return 0;
  120. }
       ^
  121. 
  122. static inline int check_sessionid(AVFormatContext *s,

static inline int check_sessionid(AVFormatContext *s,
                                  RTSPMessageHeader *request)
{
    RTSPState *rt = s->priv_data;
    unsigned char *session_id = rt->session_id;
    if (!session_id[0]) {
        av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\n");
        return 0;
    }
    if (strcmp(session_id, request->session_id)) {
        av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
               request->session_id);
        rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);
        return AVERROR_STREAM_NOT_FOUND;
    }
    return 0;
}
['static inline int check_sessionid(AVFormatContext *s,\n                                  RTSPMessageHeader *request)\n{\n    RTSPState *rt = s->priv_data;\n    unsigned char *session_id = rt->session_id;\n    if (!session_id[0]) {\n        av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\\n");\n        return 0;\n    }\n    if (strcmp(session_id, request->session_id)) {\n        av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\\n",\n               request->session_id);\n        rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);\n        return AVERROR_STREAM_NOT_FOUND;\n    }\n    return 0;\n}', 'static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,\n                           const char *extracontent, uint16_t seq)\n{\n    RTSPState *rt = s->priv_data;\n    char message[4096];\n    int index = 0;\n    while (status_messages[index].code) {\n        if (status_messages[index].code == code) {\n            snprintf(message, sizeof(message), "RTSP/1.0 %d %s\\r\\n",\n                     code, status_messages[index].message);\n            break;\n        }\n        index++;\n    }\n    if (!status_messages[index].code)\n        return AVERROR(EINVAL);\n    av_strlcatf(message, sizeof(message), "CSeq: %d\\r\\n", seq);\n    av_strlcatf(message, sizeof(message), "Server: %s\\r\\n", LIBAVFORMAT_IDENT);\n    if (extracontent)\n        av_strlcat(message, extracontent, sizeof(message));\n    av_strlcat(message, "\\r\\n", sizeof(message));\n    av_dlog(s, "Sending response:\\n%s", message);\n    ffurl_write(rt->rtsp_hd, message, strlen(message));\n    return 0;\n}']