libavformat/nutenc.c:625: error: Null Dereference
  pointer `nut->time_base` last assigned on line 589 could be null and is dereferenced at line 625, column 9.

libavformat/nutenc.c:580:1: start of procedure write_header()
578. }
579. 
580. static int write_header(AVFormatContext *s){
     ^
581.     NUTContext *nut = s->priv_data;
582.     AVIOContext *bc = s->pb;

libavformat/nutenc.c:581:5: 
579. 
580. static int write_header(AVFormatContext *s){
581.     NUTContext *nut = s->priv_data;
         ^
582.     AVIOContext *bc = s->pb;
583.     int i, j, ret;

libavformat/nutenc.c:582:5: 
580. static int write_header(AVFormatContext *s){
581.     NUTContext *nut = s->priv_data;
582.     AVIOContext *bc = s->pb;
         ^
583.     int i, j, ret;
584. 

libavformat/nutenc.c:585:5: 
583.     int i, j, ret;
584. 
585.     nut->avf= s;
         ^
586. 
587.     nut->stream   = av_mallocz(sizeof(StreamContext)*s->nb_streams);

libavformat/nutenc.c:587:5: 
585.     nut->avf= s;
586. 
587.     nut->stream   = av_mallocz(sizeof(StreamContext)*s->nb_streams);
         ^
588.     nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
589.     nut->time_base= av_mallocz(sizeof(AVRational   )*(s->nb_streams +

libavutil/mem.c:156:1: start of procedure av_mallocz()
  154. }
  155. 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
       ^
  157. {
  158.     void *ptr = av_malloc(size);

libavutil/mem.c:158:5: 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
  157. {
  158.     void *ptr = av_malloc(size);
           ^
  159.     if (ptr)
  160.         memset(ptr, 0, size);

libavutil/mem.c:64:1: start of procedure av_malloc()
    62.    linker will do it automatically. */
    63. 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
    65. {
    66.     void *ptr = NULL;
            ^
    67. #if CONFIG_MEMALIGN_HACK
    68.     long diff;

libavutil/mem.c:72:8: Taking true branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:73:9: 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
    73.         return NULL;
                ^
    74. 
    75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
    115. #endif
    116.     return ptr;
    117. }
         ^
    118. 
    119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)

libavutil/mem.c:159:9: Taking false branch
  157. {
  158.     void *ptr = av_malloc(size);
  159.     if (ptr)
               ^
  160.         memset(ptr, 0, size);
  161.     return ptr;

libavutil/mem.c:161:5: 
  159.     if (ptr)
  160.         memset(ptr, 0, size);
  161.     return ptr;
           ^
  162. }
  163. 

libavutil/mem.c:162:1: return from a call to av_mallocz
  160.         memset(ptr, 0, size);
  161.     return ptr;
  162. }
       ^
  163. 
  164. char *av_strdup(const char *s)

libavformat/nutenc.c:588:5: 
586. 
587.     nut->stream   = av_mallocz(sizeof(StreamContext)*s->nb_streams);
588.     nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
         ^
589.     nut->time_base= av_mallocz(sizeof(AVRational   )*(s->nb_streams +
590.                                                       s->nb_chapters));

libavutil/mem.c:156:1: start of procedure av_mallocz()
  154. }
  155. 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
       ^
  157. {
  158.     void *ptr = av_malloc(size);

libavutil/mem.c:158:5: 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
  157. {
  158.     void *ptr = av_malloc(size);
           ^
  159.     if (ptr)
  160.         memset(ptr, 0, size);

libavutil/mem.c:64:1: start of procedure av_malloc()
    62.    linker will do it automatically. */
    63. 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
    65. {
    66.     void *ptr = NULL;
            ^
    67. #if CONFIG_MEMALIGN_HACK
    68.     long diff;

libavutil/mem.c:72:8: Taking true branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:73:9: 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
    73.         return NULL;
                ^
    74. 
    75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
    115. #endif
    116.     return ptr;
    117. }
         ^
    118. 
    119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)

libavutil/mem.c:159:9: Taking false branch
  157. {
  158.     void *ptr = av_malloc(size);
  159.     if (ptr)
               ^
  160.         memset(ptr, 0, size);
  161.     return ptr;

libavutil/mem.c:161:5: 
  159.     if (ptr)
  160.         memset(ptr, 0, size);
  161.     return ptr;
           ^
  162. }
  163. 

libavutil/mem.c:162:1: return from a call to av_mallocz
  160.         memset(ptr, 0, size);
  161.     return ptr;
  162. }
       ^
  163. 
  164. char *av_strdup(const char *s)

libavformat/nutenc.c:589:5: 
587.     nut->stream   = av_mallocz(sizeof(StreamContext)*s->nb_streams);
588.     nut->chapter  = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
589.     nut->time_base= av_mallocz(sizeof(AVRational   )*(s->nb_streams +
         ^
590.                                                       s->nb_chapters));
591. 

libavutil/mem.c:156:1: start of procedure av_mallocz()
  154. }
  155. 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
       ^
  157. {
  158.     void *ptr = av_malloc(size);

libavutil/mem.c:158:5: 
  156. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
  157. {
  158.     void *ptr = av_malloc(size);
           ^
  159.     if (ptr)
  160.         memset(ptr, 0, size);

libavutil/mem.c:64:1: start of procedure av_malloc()
    62.    linker will do it automatically. */
    63. 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
    65. {
    66.     void *ptr = NULL;
            ^
    67. #if CONFIG_MEMALIGN_HACK
    68.     long diff;

libavutil/mem.c:72:8: Taking true branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:73:9: 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
    73.         return NULL;
                ^
    74. 
    75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
    115. #endif
    116.     return ptr;
    117. }
         ^
    118. 
    119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)

libavutil/mem.c:159:9: Taking false branch
  157. {
  158.     void *ptr = av_malloc(size);
  159.     if (ptr)
               ^
  160.         memset(ptr, 0, size);
  161.     return ptr;

libavutil/mem.c:161:5: 
  159.     if (ptr)
  160.         memset(ptr, 0, size);
  161.     return ptr;
           ^
  162. }
  163. 

libavutil/mem.c:162:1: return from a call to av_mallocz
  160.         memset(ptr, 0, size);
  161.     return ptr;
  162. }
       ^
  163. 
  164. char *av_strdup(const char *s)

libavformat/nutenc.c:592:9: 
590.                                                       s->nb_chapters));
591. 
592.     for(i=0; i<s->nb_streams; i++){
             ^
593.         AVStream *st= s->streams[i];
594.         int ssize;

libavformat/nutenc.c:592:14: Loop condition is false. Leaving loop
590.                                                       s->nb_chapters));
591. 
592.     for(i=0; i<s->nb_streams; i++){
                  ^
593.         AVStream *st= s->streams[i];
594.         int ssize;

libavformat/nutenc.c:617:10: 
615.     }
616. 
617.     for (i = 0; i < s->nb_chapters; i++) {
              ^
618.         AVChapter *ch = s->chapters[i];
619. 

libavformat/nutenc.c:617:17: Loop condition is true. Entering loop body
615.     }
616. 
617.     for (i = 0; i < s->nb_chapters; i++) {
                     ^
618.         AVChapter *ch = s->chapters[i];
619. 

libavformat/nutenc.c:618:9: 
616. 
617.     for (i = 0; i < s->nb_chapters; i++) {
618.         AVChapter *ch = s->chapters[i];
             ^
619. 
620.         for (j = 0; j < nut->time_base_count; j++) {

libavformat/nutenc.c:620:14: 
618.         AVChapter *ch = s->chapters[i];
619. 
620.         for (j = 0; j < nut->time_base_count; j++) {
                  ^
621.             if (!memcmp(&ch->time_base, &nut->time_base[j], sizeof(AVRational)))
622.                 break;

libavformat/nutenc.c:620:21: Loop condition is false. Leaving loop
618.         AVChapter *ch = s->chapters[i];
619. 
620.         for (j = 0; j < nut->time_base_count; j++) {
                         ^
621.             if (!memcmp(&ch->time_base, &nut->time_base[j], sizeof(AVRational)))
622.                 break;

libavformat/nutenc.c:625:9: 
623.         }
624. 
625.         nut->time_base[j] = ch->time_base;
             ^
626.         nut->chapter[i].time_base = &nut->time_base[j];
627.         if(j == nut->time_base_count)
