libavformat/movenc.c:1680: error: Null Dereference
  pointer `null` is dereferenced by call to `ff_sdp_write_media()` at line 1680, column 5.

libavformat/movenc.c:1674:1: start of procedure mov_write_udta_sdp()
1672. }
1673. 
1674. static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
      ^
1675. {
1676.     AVFormatContext *ctx = track->rtp_ctx;

libavformat/movenc.c:1676:5: 
1674. static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
1675. {
1676.     AVFormatContext *ctx = track->rtp_ctx;
          ^
1677.     char buf[1000] = "";
1678.     int len;

libavformat/movenc.c:1677:5: 
1675. {
1676.     AVFormatContext *ctx = track->rtp_ctx;
1677.     char buf[1000] = "";
          ^
1678.     int len;
1679. 

libavformat/movenc.c:1680:5: 
1678.     int len;
1679. 
1680.     ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,
          ^
1681.                        NULL, NULL, 0, 0, ctx);
1682.     av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id);

libavformat/sdp.c:609:1: start of procedure ff_sdp_write_media()
  607. }
  608. 
  609. void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
       ^
  610.                         const char *dest_addr, const char *dest_type,
  611.                         int port, int ttl, AVFormatContext *fmt)

libavformat/sdp.c:613:5: 
  611.                         int port, int ttl, AVFormatContext *fmt)
  612. {
  613.     AVCodecContext *c = st->codec;
           ^
  614.     const char *type;
  615.     int payload_type;

libavformat/sdp.c:617:5: Skipping ff_rtp_get_payload_type(): empty list of specs
  615.     int payload_type;
  616. 
  617.     payload_type = ff_rtp_get_payload_type(fmt, c, idx);
           ^
  618. 
  619.     switch (c->codec_type) {

libavformat/sdp.c:619:5: 
  617.     payload_type = ff_rtp_get_payload_type(fmt, c, idx);
  618. 
  619.     switch (c->codec_type) {
           ^
  620.         case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;
  621.         case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;

libavformat/sdp.c:620:9: Switch condition is false. Skipping switch case
  618. 
  619.     switch (c->codec_type) {
  620.         case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;
               ^
  621.         case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;
  622.         case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;

libavformat/sdp.c:621:9: Switch condition is false. Skipping switch case
  619.     switch (c->codec_type) {
  620.         case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;
  621.         case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;
               ^
  622.         case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;
  623.         default                 : type = "application"; break;

libavformat/sdp.c:622:9: Switch condition is false. Skipping switch case
  620.         case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;
  621.         case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;
  622.         case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;
               ^
  623.         default                 : type = "application"; break;
  624.     }

libavformat/sdp.c:623:35: 
  621.         case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;
  622.         case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;
  623.         default                 : type = "application"; break;
                                         ^
  624.     }
  625. 

libavformat/sdp.c:626:5: 
  624.     }
  625. 
  626.     av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
           ^
  627.     sdp_write_address(buff, size, dest_addr, dest_type, ttl);
  628.     if (c->bit_rate) {

libavutil/avstring.c:99:1: start of procedure av_strlcatf()
     97. }
     98. 
     99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
         ^
    100. {
    101.     int len = strlen(dst);

libavutil/avstring.c:101:5: 
     99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
    100. {
    101.     int len = strlen(dst);
             ^
    102.     va_list vl;
    103. 

libavutil/avstring.c:104:5: 
    102.     va_list vl;
    103. 
    104.     va_start(vl, fmt);
             ^
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
    106.     va_end(vl);

libavutil/avstring.c:105:33: Condition is true
    103. 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
                                         ^
    106.     va_end(vl);
    107. 

libavutil/avstring.c:105:5: 
    103. 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
             ^
    106.     va_end(vl);
    107. 

libavutil/avstring.c:106:5: 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
    106.     va_end(vl);
             ^
    107. 
    108.     return len;

libavutil/avstring.c:108:5: 
    106.     va_end(vl);
    107. 
    108.     return len;
             ^
    109. }
    110. 

libavutil/avstring.c:109:1: return from a call to av_strlcatf
    107. 
    108.     return len;
    109. }
         ^
    110. 
    111. char *av_d2str(double d)

libavformat/sdp.c:627:5: 
  625. 
  626.     av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
  627.     sdp_write_address(buff, size, dest_addr, dest_type, ttl);
           ^
  628.     if (c->bit_rate) {
  629.         av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);

libavformat/sdp.c:57:1: start of procedure sdp_write_address()
    55. };
    56. 
    57. static void sdp_write_address(char *buff, int size, const char *dest_addr,
        ^
    58.                               const char *dest_type, int ttl)
    59. {

libavformat/sdp.c:60:9: Taking true branch
    58.                               const char *dest_type, int ttl)
    59. {
    60.     if (dest_addr) {
                ^
    61.         if (!dest_type)
    62.             dest_type = "IP4";

libavformat/sdp.c:61:14: Taking false branch
    59. {
    60.     if (dest_addr) {
    61.         if (!dest_type)
                     ^
    62.             dest_type = "IP4";
    63.         if (ttl > 0 && !strcmp(dest_type, "IP4")) {

libavformat/sdp.c:63:13: Taking true branch
    61.         if (!dest_type)
    62.             dest_type = "IP4";
    63.         if (ttl > 0 && !strcmp(dest_type, "IP4")) {
                    ^
    64.             /* The TTL should only be specified for IPv4 multicast addresses,
    65.              * not for IPv6. */

libavformat/sdp.c:63:25: Taking false branch
    61.         if (!dest_type)
    62.             dest_type = "IP4";
    63.         if (ttl > 0 && !strcmp(dest_type, "IP4")) {
                                ^
    64.             /* The TTL should only be specified for IPv4 multicast addresses,
    65.              * not for IPv6. */

libavformat/sdp.c:68:13: 
    66.             av_strlcatf(buff, size, "c=IN %s %s/%d\r\n", dest_type, dest_addr, ttl);
    67.         } else {
    68.             av_strlcatf(buff, size, "c=IN %s %s\r\n", dest_type, dest_addr);
                    ^
    69.         }
    70.     }

libavutil/avstring.c:99:1: start of procedure av_strlcatf()
       97. }
       98. 
       99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
           ^
      100. {
      101.     int len = strlen(dst);

libavutil/avstring.c:101:5: 
       99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
      100. {
      101.     int len = strlen(dst);
               ^
      102.     va_list vl;
      103. 

libavutil/avstring.c:104:5: 
      102.     va_list vl;
      103. 
      104.     va_start(vl, fmt);
               ^
      105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
      106.     va_end(vl);

libavutil/avstring.c:105:33: Condition is true
      103. 
      104.     va_start(vl, fmt);
      105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
                                           ^
      106.     va_end(vl);
      107. 

libavutil/avstring.c:105:5: 
      103. 
      104.     va_start(vl, fmt);
      105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
               ^
      106.     va_end(vl);
      107. 

libavutil/avstring.c:106:5: 
      104.     va_start(vl, fmt);
      105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
      106.     va_end(vl);
               ^
      107. 
      108.     return len;

libavutil/avstring.c:108:5: 
      106.     va_end(vl);
      107. 
      108.     return len;
               ^
      109. }
      110. 

libavutil/avstring.c:109:1: return from a call to av_strlcatf
      107. 
      108.     return len;
      109. }
           ^
      110. 
      111. char *av_d2str(double d)

libavformat/sdp.c:60:5: 
    58.                               const char *dest_type, int ttl)
    59. {
    60.     if (dest_addr) {
            ^
    61.         if (!dest_type)
    62.             dest_type = "IP4";

libavformat/sdp.c:71:1: return from a call to sdp_write_address
    69.         }
    70.     }
    71. }
        ^
    72. 
    73. static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)

libavformat/sdp.c:628:9: Taking true branch
  626.     av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
  627.     sdp_write_address(buff, size, dest_addr, dest_type, ttl);
  628.     if (c->bit_rate) {
               ^
  629.         av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
  630.     }

libavformat/sdp.c:629:9: 
  627.     sdp_write_address(buff, size, dest_addr, dest_type, ttl);
  628.     if (c->bit_rate) {
  629.         av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
               ^
  630.     }
  631. 

libavutil/avstring.c:99:1: start of procedure av_strlcatf()
     97. }
     98. 
     99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
         ^
    100. {
    101.     int len = strlen(dst);

libavutil/avstring.c:101:5: 
     99. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
    100. {
    101.     int len = strlen(dst);
             ^
    102.     va_list vl;
    103. 

libavutil/avstring.c:104:5: 
    102.     va_list vl;
    103. 
    104.     va_start(vl, fmt);
             ^
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
    106.     va_end(vl);

libavutil/avstring.c:105:33: Condition is true
    103. 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
                                         ^
    106.     va_end(vl);
    107. 

libavutil/avstring.c:105:5: 
    103. 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
             ^
    106.     va_end(vl);
    107. 

libavutil/avstring.c:106:5: 
    104.     va_start(vl, fmt);
    105.     len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
    106.     va_end(vl);
             ^
    107. 
    108.     return len;

libavutil/avstring.c:108:5: 
    106.     va_end(vl);
    107. 
    108.     return len;
             ^
    109. }
    110. 

libavutil/avstring.c:109:1: return from a call to av_strlcatf
    107. 
    108.     return len;
    109. }
         ^
    110. 
    111. char *av_d2str(double d)

libavformat/sdp.c:632:5: Skipping sdp_write_media_attributes(): empty list of specs
  630.     }
  631. 
  632.     sdp_write_media_attributes(buff, size, c, payload_type, fmt);
           ^
  633. }
  634. 

libavformat/sdp.c:633:1: return from a call to ff_sdp_write_media
  631. 
  632.     sdp_write_media_attributes(buff, size, c, payload_type, fmt);
  633. }
       ^
  634. 
  635. int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)

static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
{
    AVFormatContext *ctx = track->rtp_ctx;
    char buf[1000] = "";
    int len;
    ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,
                       NULL, NULL, 0, 0, ctx);
    av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id);
    len = strlen(buf);
    avio_wb32(pb, len + 24);
    ffio_wfourcc(pb, "udta");
    avio_wb32(pb, len + 16);
    ffio_wfourcc(pb, "hnti");
    avio_wb32(pb, len + 8);
    ffio_wfourcc(pb, "sdp ");
    avio_write(pb, buf, len);
    return len + 24;
}
['static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)\n{\n    AVFormatContext *ctx = track->rtp_ctx;\n    char buf[1000] = "";\n    int len;\n    ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,\n                       NULL, NULL, 0, 0, ctx);\n    av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\\r\\n", track->track_id);\n    len = strlen(buf);\n    avio_wb32(pb, len + 24);\n    ffio_wfourcc(pb, "udta");\n    avio_wb32(pb, len + 16);\n    ffio_wfourcc(pb, "hnti");\n    avio_wb32(pb, len + 8);\n    ffio_wfourcc(pb, "sdp ");\n    avio_write(pb, buf, len);\n    return len + 24;\n}', 'void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,\n                        const char *dest_addr, const char *dest_type,\n                        int port, int ttl, AVFormatContext *fmt)\n{\n    AVCodecContext *c = st->codec;\n    const char *type;\n    int payload_type;\n    payload_type = ff_rtp_get_payload_type(fmt, c, idx);\n    switch (c->codec_type) {\n        case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;\n        case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;\n        case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;\n        default                 : type = "application"; break;\n    }\n    av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\\r\\n", type, port, payload_type);\n    sdp_write_address(buff, size, dest_addr, dest_type, ttl);\n    if (c->bit_rate) {\n        av_strlcatf(buff, size, "b=AS:%d\\r\\n", c->bit_rate / 1000);\n    }\n    sdp_write_media_attributes(buff, size, c, payload_type, fmt);\n}', 'size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)\n{\n    int len = strlen(dst);\n    va_list vl;\n    va_start(vl, fmt);\n    len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);\n    va_end(vl);\n    return len;\n}', 'static void sdp_write_address(char *buff, int size, const char *dest_addr,\n                              const char *dest_type, int ttl)\n{\n    if (dest_addr) {\n        if (!dest_type)\n            dest_type = "IP4";\n        if (ttl > 0 && !strcmp(dest_type, "IP4")) {\n            av_strlcatf(buff, size, "c=IN %s %s/%d\\r\\n", dest_type, dest_addr, ttl);\n        } else {\n            av_strlcatf(buff, size, "c=IN %s %s\\r\\n", dest_type, dest_addr);\n        }\n    }\n}']