libavfilter/af_resample.c:101: error: Null Dereference
  pointer `in_formats` last assigned on line 94 could be null and is dereferenced by call to `ff_formats_ref()` at line 101, column 5.

libavfilter/af_resample.c:89:1: start of procedure query_formats()
87. }
88. 
89. static int query_formats(AVFilterContext *ctx)
    ^
90. {
91.     AVFilterLink *inlink  = ctx->inputs[0];

libavfilter/af_resample.c:91:5: 
89. static int query_formats(AVFilterContext *ctx)
90. {
91.     AVFilterLink *inlink  = ctx->inputs[0];
        ^
92.     AVFilterLink *outlink = ctx->outputs[0];
93. 

libavfilter/af_resample.c:92:5: 
90. {
91.     AVFilterLink *inlink  = ctx->inputs[0];
92.     AVFilterLink *outlink = ctx->outputs[0];
        ^
93. 
94.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);

libavfilter/af_resample.c:94:5: 
92.     AVFilterLink *outlink = ctx->outputs[0];
93. 
94.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
        ^
95.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();

libavfilter/formats.c:218:1: start of procedure ff_all_formats()
  216. }
  217. 
  218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
       ^
  219. {
  220.     AVFilterFormats *ret = NULL;

libavfilter/formats.c:220:5: 
  218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
  219. {
  220.     AVFilterFormats *ret = NULL;
           ^
  221. 
  222.     if (type == AVMEDIA_TYPE_VIDEO) {

libavfilter/formats.c:222:9: Taking false branch
  220.     AVFilterFormats *ret = NULL;
  221. 
  222.     if (type == AVMEDIA_TYPE_VIDEO) {
               ^
  223.         const AVPixFmtDescriptor *desc = NULL;
  224.         while ((desc = av_pix_fmt_desc_next(desc))) {

libavfilter/formats.c:227:16: Taking true branch
  225.             ff_add_format(&ret, av_pix_fmt_desc_get_id(desc));
  226.         }
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
                      ^
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {

libavfilter/formats.c:228:9: 
  226.         }
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
               ^
  229.         while (av_get_sample_fmt_name(fmt)) {
  230.             ff_add_format(&ret, fmt);

libavfilter/formats.c:229:16: 
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {
                      ^
  230.             ff_add_format(&ret, fmt);
  231.             fmt++;

libavutil/samplefmt.c:47:1: start of procedure av_get_sample_fmt_name()
    45. };
    46. 
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
        ^
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)

libavutil/samplefmt.c:49:9: Taking false branch
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                ^
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;

libavutil/samplefmt.c:49:27: Taking false branch
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                                  ^
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;

libavutil/samplefmt.c:51:5: 
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;
            ^
    52. }
    53. 

libavutil/samplefmt.c:52:1: return from a call to av_get_sample_fmt_name
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;
    52. }
        ^
    53. 
    54. enum AVSampleFormat av_get_sample_fmt(const char *name)

libavfilter/formats.c:229:16: Loop condition is false. Leaving loop
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {
                      ^
  230.             ff_add_format(&ret, fmt);
  231.             fmt++;

libavfilter/formats.c:235:5: 
  233.     }
  234. 
  235.     return ret;
           ^
  236. }
  237. 

libavfilter/formats.c:236:1: return from a call to ff_all_formats
  234. 
  235.     return ret;
  236. }
       ^
  237. 
  238. AVFilterFormats *ff_planar_sample_fmts(void)

libavfilter/af_resample.c:95:5: 
93. 
94.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
95.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
        ^
96.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
97.     AVFilterFormats        *out_samplerates = ff_all_samplerates();

libavfilter/formats.c:218:1: start of procedure ff_all_formats()
  216. }
  217. 
  218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
       ^
  219. {
  220.     AVFilterFormats *ret = NULL;

libavfilter/formats.c:220:5: 
  218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
  219. {
  220.     AVFilterFormats *ret = NULL;
           ^
  221. 
  222.     if (type == AVMEDIA_TYPE_VIDEO) {

libavfilter/formats.c:222:9: Taking false branch
  220.     AVFilterFormats *ret = NULL;
  221. 
  222.     if (type == AVMEDIA_TYPE_VIDEO) {
               ^
  223.         const AVPixFmtDescriptor *desc = NULL;
  224.         while ((desc = av_pix_fmt_desc_next(desc))) {

libavfilter/formats.c:227:16: Taking true branch
  225.             ff_add_format(&ret, av_pix_fmt_desc_get_id(desc));
  226.         }
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
                      ^
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {

libavfilter/formats.c:228:9: 
  226.         }
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
               ^
  229.         while (av_get_sample_fmt_name(fmt)) {
  230.             ff_add_format(&ret, fmt);

libavfilter/formats.c:229:16: 
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {
                      ^
  230.             ff_add_format(&ret, fmt);
  231.             fmt++;

libavutil/samplefmt.c:47:1: start of procedure av_get_sample_fmt_name()
    45. };
    46. 
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
        ^
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)

libavutil/samplefmt.c:49:9: Taking false branch
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                ^
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;

libavutil/samplefmt.c:49:27: Taking false branch
    47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
    48. {
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
                                  ^
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;

libavutil/samplefmt.c:51:5: 
    49.     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;
            ^
    52. }
    53. 

libavutil/samplefmt.c:52:1: return from a call to av_get_sample_fmt_name
    50.         return NULL;
    51.     return sample_fmt_info[sample_fmt].name;
    52. }
        ^
    53. 
    54. enum AVSampleFormat av_get_sample_fmt(const char *name)

libavfilter/formats.c:229:16: Loop condition is false. Leaving loop
  227.     } else if (type == AVMEDIA_TYPE_AUDIO) {
  228.         enum AVSampleFormat fmt = 0;
  229.         while (av_get_sample_fmt_name(fmt)) {
                      ^
  230.             ff_add_format(&ret, fmt);
  231.             fmt++;

libavfilter/formats.c:235:5: 
  233.     }
  234. 
  235.     return ret;
           ^
  236. }
  237. 

libavfilter/formats.c:236:1: return from a call to ff_all_formats
  234. 
  235.     return ret;
  236. }
       ^
  237. 
  238. AVFilterFormats *ff_planar_sample_fmts(void)

libavfilter/af_resample.c:96:5: Skipping ff_all_samplerates(): empty list of specs
94.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
95.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
        ^
97.     AVFilterFormats        *out_samplerates = ff_all_samplerates();
98.     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();

libavfilter/af_resample.c:97:5: Skipping ff_all_samplerates(): empty list of specs
95.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
97.     AVFilterFormats        *out_samplerates = ff_all_samplerates();
        ^
98.     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
99.     AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();

libavfilter/af_resample.c:98:5: Skipping ff_all_channel_layouts(): empty list of specs
 96.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
 97.     AVFilterFormats        *out_samplerates = ff_all_samplerates();
 98.     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
         ^
 99.     AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();
100. 

libavfilter/af_resample.c:99:5: Skipping ff_all_channel_layouts(): empty list of specs
 97.     AVFilterFormats        *out_samplerates = ff_all_samplerates();
 98.     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();
 99.     AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();
         ^
100. 
101.     ff_formats_ref(in_formats,  &inlink->out_formats);

libavfilter/af_resample.c:101:5: 
 99.     AVFilterChannelLayouts *out_layouts     = ff_all_channel_layouts();
100. 
101.     ff_formats_ref(in_formats,  &inlink->out_formats);
         ^
102.     ff_formats_ref(out_formats, &outlink->in_formats);
103. 

libavfilter/formats.c:276:1: start of procedure ff_formats_ref()
  274. }
  275. 
  276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
       ^
  277. {
  278.     FORMATS_REF(f, ref);

libavfilter/formats.c:278:5: 
  276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
  277. {
  278.     FORMATS_REF(f, ref);
           ^
  279. }
  280. 
