libavfilter/vf_aspect.c:118: error: Null Dereference
  pointer `desc` last assigned on line 105 could be null and is dereferenced at line 118, column 34.

libavfilter/vf_aspect.c:101:1: start of procedure get_aspect_ratio()
 99. #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
100. 
101. static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)
     ^
102. {
103.     AVFilterContext *ctx = inlink->dst;

libavfilter/vf_aspect.c:103:5: 
101. static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)
102. {
103.     AVFilterContext *ctx = inlink->dst;
         ^
104.     AspectContext *s = inlink->dst->priv;
105.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);

libavfilter/vf_aspect.c:104:5: 
102. {
103.     AVFilterContext *ctx = inlink->dst;
104.     AspectContext *s = inlink->dst->priv;
         ^
105.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
106.     double var_values[VARS_NB], res;

libavfilter/vf_aspect.c:105:5: 
103.     AVFilterContext *ctx = inlink->dst;
104.     AspectContext *s = inlink->dst->priv;
105.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
         ^
106.     double var_values[VARS_NB], res;
107.     int ret;

libavutil/pixdesc.c:1504:1: start of procedure av_pix_fmt_desc_get()
  1502. }
  1503. 
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1506:9: Taking false branch
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1506:24: Taking true branch
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1507:9: 
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1507.         return NULL;
                ^
  1508.     return &av_pix_fmt_descriptors[pix_fmt];
  1509. }

libavutil/pixdesc.c:1509:1: return from a call to av_pix_fmt_desc_get
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];
  1509. }
        ^
  1510. 
  1511. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/vf_aspect.c:109:5: 
107.     int ret;
108. 
109.     var_values[VAR_PI]    = M_PI;
         ^
110.     var_values[VAR_PHI]   = M_PHI;
111.     var_values[VAR_E]     = M_E;

libavfilter/vf_aspect.c:110:5: 
108. 
109.     var_values[VAR_PI]    = M_PI;
110.     var_values[VAR_PHI]   = M_PHI;
         ^
111.     var_values[VAR_E]     = M_E;
112.     var_values[VAR_W]     = inlink->w;

libavfilter/vf_aspect.c:111:5: 
109.     var_values[VAR_PI]    = M_PI;
110.     var_values[VAR_PHI]   = M_PHI;
111.     var_values[VAR_E]     = M_E;
         ^
112.     var_values[VAR_W]     = inlink->w;
113.     var_values[VAR_H]     = inlink->h;

libavfilter/vf_aspect.c:112:5: 
110.     var_values[VAR_PHI]   = M_PHI;
111.     var_values[VAR_E]     = M_E;
112.     var_values[VAR_W]     = inlink->w;
         ^
113.     var_values[VAR_H]     = inlink->h;
114.     var_values[VAR_A]     = (double) inlink->w / inlink->h;

libavfilter/vf_aspect.c:113:5: 
111.     var_values[VAR_E]     = M_E;
112.     var_values[VAR_W]     = inlink->w;
113.     var_values[VAR_H]     = inlink->h;
         ^
114.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
115.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?

libavfilter/vf_aspect.c:114:5: 
112.     var_values[VAR_W]     = inlink->w;
113.     var_values[VAR_H]     = inlink->h;
114.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
         ^
115.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
116.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;

libavfilter/vf_aspect.c:115:29: Condition is true
113.     var_values[VAR_H]     = inlink->h;
114.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
115.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
                                 ^
116.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
117.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];

libavfilter/vf_aspect.c:115:5: 
113.     var_values[VAR_H]     = inlink->h;
114.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
115.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
         ^
116.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
117.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];

libavfilter/vf_aspect.c:117:5: 
115.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
116.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
117.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
         ^
118.     var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
119.     var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;

libavfilter/vf_aspect.c:118:5: 
116.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
117.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
118.     var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
         ^
119.     var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
120. 

static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)
{
    AVFilterContext *ctx = inlink->dst;
    AspectContext *s = inlink->dst->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    double var_values[VARS_NB], res;
    int ret;
    var_values[VAR_PI]    = M_PI;
    var_values[VAR_PHI]   = M_PHI;
    var_values[VAR_E]     = M_E;
    var_values[VAR_W]     = inlink->w;
    var_values[VAR_H]     = inlink->h;
    var_values[VAR_A]     = (double) inlink->w / inlink->h;
    var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
        (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
    var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
    var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
    var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
    if ((ret = av_expr_parse_and_eval(&res, s->ratio_expr,
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
        av_log(NULL, AV_LOG_ERROR,
               "Error when evaluating the expression '%s'\n", s->ratio_expr);
        return ret;
    }
    *aspect_ratio = av_d2q(res, INT_MAX);
    return 0;
}
['static int get_aspect_ratio(AVFilterLink *inlink, AVRational *aspect_ratio)\n{\n    AVFilterContext *ctx = inlink->dst;\n    AspectContext *s = inlink->dst->priv;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);\n    double var_values[VARS_NB], res;\n    int ret;\n    var_values[VAR_PI]    = M_PI;\n    var_values[VAR_PHI]   = M_PHI;\n    var_values[VAR_E]     = M_E;\n    var_values[VAR_W]     = inlink->w;\n    var_values[VAR_H]     = inlink->h;\n    var_values[VAR_A]     = (double) inlink->w / inlink->h;\n    var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?\n        (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;\n    var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];\n    var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;\n    var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;\n    if ((ret = av_expr_parse_and_eval(&res, s->ratio_expr,\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {\n        av_log(NULL, AV_LOG_ERROR,\n               "Error when evaluating the expression \'%s\'\\n", s->ratio_expr);\n        return ret;\n    }\n    *aspect_ratio = av_d2q(res, INT_MAX);\n    return 0;\n}', 'const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)\n{\n    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)\n        return NULL;\n    return &av_pix_fmt_descriptors[pix_fmt];\n}']