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

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

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

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

libavfilter/af_resample.c:95:5: 
93.     AVFilterLink *outlink = ctx->outputs[0];
94. 
95.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
        ^
96.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
97.     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:96:5: 
94. 
95.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
        ^
97.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
98.     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:97:5: Skipping ff_all_samplerates(): empty list of specs
95.     AVFilterFormats        *in_formats      = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96.     AVFilterFormats        *out_formats     = ff_all_formats(AVMEDIA_TYPE_AUDIO);
97.     AVFilterFormats        *in_samplerates  = ff_all_samplerates();
        ^
98.     AVFilterFormats        *out_samplerates = ff_all_samplerates();
99.     AVFilterChannelLayouts *in_layouts      = ff_all_channel_layouts();

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

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

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

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

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. 
