libavfilter/defaults.c:148: error: Null Dereference
  pointer `outlink->out_buf` last assigned on line 145 could be null and is dereferenced at line 148, column 9.

libavfilter/defaults.c:137:1: start of procedure avfilter_default_filter_samples()
135. 
136. /* FIXME: samplesref is same as link->cur_buf. Need to consider removing the redundant parameter. */
137. void avfilter_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
     ^
138. {
139.     AVFilterLink *outlink = NULL;

libavfilter/defaults.c:139:5: 
137. void avfilter_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
138. {
139.     AVFilterLink *outlink = NULL;
         ^
140. 
141.     if (inlink->dst->output_count)

libavfilter/defaults.c:141:9: Taking true branch
139.     AVFilterLink *outlink = NULL;
140. 
141.     if (inlink->dst->output_count)
             ^
142.         outlink = inlink->dst->outputs[0];
143. 

libavfilter/defaults.c:142:9: 
140. 
141.     if (inlink->dst->output_count)
142.         outlink = inlink->dst->outputs[0];
             ^
143. 
144.     if (outlink) {

libavfilter/defaults.c:144:9: Taking true branch
142.         outlink = inlink->dst->outputs[0];
143. 
144.     if (outlink) {
             ^
145.         outlink->out_buf = avfilter_default_get_audio_buffer(inlink, AV_PERM_WRITE, samplesref->format,
146.                                                              samplesref->audio->nb_samples,

libavfilter/defaults.c:145:9: 
143. 
144.     if (outlink) {
145.         outlink->out_buf = avfilter_default_get_audio_buffer(inlink, AV_PERM_WRITE, samplesref->format,
             ^
146.                                                              samplesref->audio->nb_samples,
147.                                                              samplesref->audio->channel_layout);

libavfilter/defaults.c:60:1: start of procedure avfilter_default_get_audio_buffer()
  58. }
  59. 
  60. AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
      ^
  61.                                                      enum AVSampleFormat sample_fmt, int nb_samples,
  62.                                                      uint64_t channel_layout)

libavfilter/defaults.c:64:5: 
  62.                                                      uint64_t channel_layout)
  63. {
  64.     AVFilterBufferRef *samplesref = NULL;
          ^
  65.     uint8_t **data;
  66.     int planar      = av_sample_fmt_is_planar(sample_fmt);

libavfilter/defaults.c:66:5: 
  64.     AVFilterBufferRef *samplesref = NULL;
  65.     uint8_t **data;
  66.     int planar      = av_sample_fmt_is_planar(sample_fmt);
          ^
  67.     int nb_channels = av_get_channel_layout_nb_channels(channel_layout);
  68.     int planes      = planar ? nb_channels : 1;

libavutil/samplefmt.c:108:1: start of procedure av_sample_fmt_is_planar()
    106. #endif
    107. 
    108. int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
         ^
    109. {
    110.      if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)

libavutil/samplefmt.c:110:10: Taking false branch
    108. int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
    109. {
    110.      if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                  ^
    111.          return 0;
    112.      return sample_fmt_info[sample_fmt].planar;

libavutil/samplefmt.c:110:28: Taking false branch
    108. int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
    109. {
    110.      if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                                    ^
    111.          return 0;
    112.      return sample_fmt_info[sample_fmt].planar;

libavutil/samplefmt.c:112:6: 
    110.      if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
    111.          return 0;
    112.      return sample_fmt_info[sample_fmt].planar;
              ^
    113. }
    114. 

libavutil/samplefmt.c:113:1: return from a call to av_sample_fmt_is_planar
    111.          return 0;
    112.      return sample_fmt_info[sample_fmt].planar;
    113. }
         ^
    114. 
    115. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,

libavfilter/defaults.c:67:5: 
  65.     uint8_t **data;
  66.     int planar      = av_sample_fmt_is_planar(sample_fmt);
  67.     int nb_channels = av_get_channel_layout_nb_channels(channel_layout);
          ^
  68.     int planes      = planar ? nb_channels : 1;
  69.     int linesize;

libavutil/audioconvert.c:176:1: start of procedure av_get_channel_layout_nb_channels()
    174. }
    175. 
    176. int av_get_channel_layout_nb_channels(uint64_t channel_layout)
         ^
    177. {
    178.     int count;

libavutil/audioconvert.c:179:5: 
    177. {
    178.     int count;
    179.     uint64_t x = channel_layout;
             ^
    180.     for (count = 0; x; count++)
    181.         x &= x-1; // unset lowest set bit

libavutil/audioconvert.c:180:10: 
    178.     int count;
    179.     uint64_t x = channel_layout;
    180.     for (count = 0; x; count++)
                  ^
    181.         x &= x-1; // unset lowest set bit
    182.     return count;

libavutil/audioconvert.c:180:21: Loop condition is false. Leaving loop
    178.     int count;
    179.     uint64_t x = channel_layout;
    180.     for (count = 0; x; count++)
                             ^
    181.         x &= x-1; // unset lowest set bit
    182.     return count;

libavutil/audioconvert.c:182:5: 
    180.     for (count = 0; x; count++)
    181.         x &= x-1; // unset lowest set bit
    182.     return count;
             ^
    183. }
    184. 

libavutil/audioconvert.c:183:1: return from a call to av_get_channel_layout_nb_channels
    181.         x &= x-1; // unset lowest set bit
    182.     return count;
    183. }
         ^
    184. 
    185. uint64_t av_get_default_channel_layout(int nb_channels)

libavfilter/defaults.c:68:23: Condition is true
  66.     int planar      = av_sample_fmt_is_planar(sample_fmt);
  67.     int nb_channels = av_get_channel_layout_nb_channels(channel_layout);
  68.     int planes      = planar ? nb_channels : 1;
                            ^
  69.     int linesize;
  70. 

libavfilter/defaults.c:68:5: 
  66.     int planar      = av_sample_fmt_is_planar(sample_fmt);
  67.     int nb_channels = av_get_channel_layout_nb_channels(channel_layout);
  68.     int planes      = planar ? nb_channels : 1;
          ^
  69.     int linesize;
  70. 

libavfilter/defaults.c:71:11: 
  69.     int linesize;
  70. 
  71.     if (!(data = av_mallocz(sizeof(*data) * planes)))
                ^
  72.         goto fail;
  73. 

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

libavutil/mem.c:158:5: 
    156. void *av_mallocz(size_t 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(size_t size)
          ^
      65. {
      66.     void *ptr = NULL;

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

libavutil/mem.c:71:5: 
      69. #endif
      70. 
      71.     assert(size);
              ^
      72. 
      73.     /* let's disallow possible ambiguous cases */

libavutil/mem.c:74:9: Taking false branch
      72. 
      73.     /* let's disallow possible ambiguous cases */
      74.     if (size > (INT_MAX-32) || !size)
                  ^
      75.         return NULL;
      76. 

libavutil/mem.c:74:33: Taking true branch
      72. 
      73.     /* let's disallow possible ambiguous cases */
      74.     if (size > (INT_MAX-32) || !size)
                                          ^
      75.         return NULL;
      76. 

libavutil/mem.c:75:9: 
      73.     /* let's disallow possible ambiguous cases */
      74.     if (size > (INT_MAX-32) || !size)
      75.         return NULL;
                  ^
      76. 
      77. #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, size_t 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)

libavfilter/defaults.c:71:11: Taking true branch
  69.     int linesize;
  70. 
  71.     if (!(data = av_mallocz(sizeof(*data) * planes)))
                ^
  72.         goto fail;
  73. 

libavfilter/defaults.c:85:1: 
  83.     av_freep(&data);
  84. 
  85. fail:
      ^
  86.     if (data)
  87.         av_freep(&data[0]);

libavfilter/defaults.c:86:9: Taking false branch
  84. 
  85. fail:
  86.     if (data)
              ^
  87.         av_freep(&data[0]);
  88.     av_freep(&data);

libavfilter/defaults.c:88:5: 
  86.     if (data)
  87.         av_freep(&data[0]);
  88.     av_freep(&data);
          ^
  89.     return samplesref;
  90. }

libavutil/mem.c:149:1: start of procedure av_freep()
    147. }
    148. 
    149. void av_freep(void *arg)
         ^
    150. {
    151.     void **ptr= (void**)arg;

libavutil/mem.c:151:5: 
    149. void av_freep(void *arg)
    150. {
    151.     void **ptr= (void**)arg;
             ^
    152.     av_free(*ptr);
    153.     *ptr = NULL;

libavutil/mem.c:152:5: 
    150. {
    151.     void **ptr= (void**)arg;
    152.     av_free(*ptr);
             ^
    153.     *ptr = NULL;
    154. }

libavutil/mem.c:139:1: start of procedure av_free()
      137. }
      138. 
      139. void av_free(void *ptr)
           ^
      140. {
      141. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:145:5: 
      143.         free((char*)ptr - ((char*)ptr)[-1]);
      144. #else
      145.     free(ptr);
               ^
      146. #endif
      147. }

libavutil/mem.c:147:1: return from a call to av_free
      145.     free(ptr);
      146. #endif
      147. }
           ^
      148. 
      149. void av_freep(void *arg)

libavutil/mem.c:153:5: 
    151.     void **ptr= (void**)arg;
    152.     av_free(*ptr);
    153.     *ptr = NULL;
             ^
    154. }
    155. 

libavutil/mem.c:154:1: return from a call to av_freep
    152.     av_free(*ptr);
    153.     *ptr = NULL;
    154. }
         ^
    155. 
    156. void *av_mallocz(size_t size)

libavfilter/defaults.c:89:5: 
  87.         av_freep(&data[0]);
  88.     av_freep(&data);
  89.     return samplesref;
          ^
  90. }
  91. 

libavfilter/defaults.c:90:1: return from a call to avfilter_default_get_audio_buffer
  88.     av_freep(&data);
  89.     return samplesref;
  90. }
      ^
  91. 
  92. void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)

libavfilter/defaults.c:148:9: 
146.                                                              samplesref->audio->nb_samples,
147.                                                              samplesref->audio->channel_layout);
148.         outlink->out_buf->pts                = samplesref->pts;
             ^
149.         outlink->out_buf->audio->sample_rate = samplesref->audio->sample_rate;
150.         avfilter_filter_samples(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
