libavfilter/vf_crop.c:180: error: Null Dereference
  pointer `pix_desc` last assigned on line 161 could be null and is dereferenced at line 180, column 18.

libavfilter/vf_crop.c:157:1: start of procedure config_input()
155. }
156. 
157. static int config_input(AVFilterLink *link)
     ^
158. {
159.     AVFilterContext *ctx = link->dst;

libavfilter/vf_crop.c:159:5: 
157. static int config_input(AVFilterLink *link)
158. {
159.     AVFilterContext *ctx = link->dst;
         ^
160.     CropContext *crop = ctx->priv;
161.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);

libavfilter/vf_crop.c:160:5: 
158. {
159.     AVFilterContext *ctx = link->dst;
160.     CropContext *crop = ctx->priv;
         ^
161.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);
162.     int ret;

libavfilter/vf_crop.c:161:5: 
159.     AVFilterContext *ctx = link->dst;
160.     CropContext *crop = ctx->priv;
161.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);
         ^
162.     int ret;
163.     const char *expr;

libavutil/pixdesc.c:1199:1: start of procedure av_pix_fmt_desc_get()
  1197. }
  1198. 
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1201:9: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1201:24: Taking true branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1202:9: 
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1202.         return NULL;
                ^
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }

libavutil/pixdesc.c:1204:1: return from a call to av_pix_fmt_desc_get
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }
        ^
  1205. 
  1206. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/vf_crop.c:166:5: 
164.     double res;
165. 
166.     crop->var_values[VAR_E]     = M_E;
         ^
167.     crop->var_values[VAR_PHI]   = M_PHI;
168.     crop->var_values[VAR_PI]    = M_PI;

libavfilter/vf_crop.c:167:5: 
165. 
166.     crop->var_values[VAR_E]     = M_E;
167.     crop->var_values[VAR_PHI]   = M_PHI;
         ^
168.     crop->var_values[VAR_PI]    = M_PI;
169.     crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;

libavfilter/vf_crop.c:168:5: 
166.     crop->var_values[VAR_E]     = M_E;
167.     crop->var_values[VAR_PHI]   = M_PHI;
168.     crop->var_values[VAR_PI]    = M_PI;
         ^
169.     crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
170.     crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;

libavfilter/vf_crop.c:169:5: 
167.     crop->var_values[VAR_PHI]   = M_PHI;
168.     crop->var_values[VAR_PI]    = M_PI;
169.     crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
         ^
170.     crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
171.     crop->var_values[VAR_X]     = NAN;

libavfilter/vf_crop.c:170:5: 
168.     crop->var_values[VAR_PI]    = M_PI;
169.     crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
170.     crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
         ^
171.     crop->var_values[VAR_X]     = NAN;
172.     crop->var_values[VAR_Y]     = NAN;

libavfilter/vf_crop.c:171:5: Skipping __builtin_nanf(): method has no implementation
169.     crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
170.     crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
171.     crop->var_values[VAR_X]     = NAN;
         ^
172.     crop->var_values[VAR_Y]     = NAN;
173.     crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;

libavfilter/vf_crop.c:172:5: Skipping __builtin_nanf(): method has no implementation
170.     crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
171.     crop->var_values[VAR_X]     = NAN;
172.     crop->var_values[VAR_Y]     = NAN;
         ^
173.     crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;
174.     crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;

libavfilter/vf_crop.c:173:5: Skipping __builtin_nanf(): method has no implementation
171.     crop->var_values[VAR_X]     = NAN;
172.     crop->var_values[VAR_Y]     = NAN;
173.     crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;
         ^
174.     crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
175.     crop->var_values[VAR_N]     = 0;

libavfilter/vf_crop.c:174:5: Skipping __builtin_nanf(): method has no implementation
172.     crop->var_values[VAR_Y]     = NAN;
173.     crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;
174.     crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
         ^
175.     crop->var_values[VAR_N]     = 0;
176.     crop->var_values[VAR_T]     = NAN;

libavfilter/vf_crop.c:175:5: 
173.     crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;
174.     crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
175.     crop->var_values[VAR_N]     = 0;
         ^
176.     crop->var_values[VAR_T]     = NAN;
177.     crop->var_values[VAR_POS]   = NAN;

libavfilter/vf_crop.c:176:5: Skipping __builtin_nanf(): method has no implementation
174.     crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
175.     crop->var_values[VAR_N]     = 0;
176.     crop->var_values[VAR_T]     = NAN;
         ^
177.     crop->var_values[VAR_POS]   = NAN;
178. 

libavfilter/vf_crop.c:177:5: Skipping __builtin_nanf(): method has no implementation
175.     crop->var_values[VAR_N]     = 0;
176.     crop->var_values[VAR_T]     = NAN;
177.     crop->var_values[VAR_POS]   = NAN;
         ^
178. 
179.     av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);

libavfilter/vf_crop.c:179:5: Skipping av_image_fill_max_pixsteps(): empty list of specs
177.     crop->var_values[VAR_POS]   = NAN;
178. 
179.     av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);
         ^
180.     crop->hsub = pix_desc->log2_chroma_w;
181.     crop->vsub = pix_desc->log2_chroma_h;

libavfilter/vf_crop.c:180:5: 
178. 
179.     av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);
180.     crop->hsub = pix_desc->log2_chroma_w;
         ^
181.     crop->vsub = pix_desc->log2_chroma_h;
182. 

static int config_input(AVFilterLink *link)
{
    AVFilterContext *ctx = link->dst;
    CropContext *crop = ctx->priv;
    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);
    int ret;
    const char *expr;
    double res;
    crop->var_values[VAR_E]     = M_E;
    crop->var_values[VAR_PHI]   = M_PHI;
    crop->var_values[VAR_PI]    = M_PI;
    crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
    crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
    crop->var_values[VAR_X]     = NAN;
    crop->var_values[VAR_Y]     = NAN;
    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;
    crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;
    crop->var_values[VAR_N]     = 0;
    crop->var_values[VAR_T]     = NAN;
    crop->var_values[VAR_POS]   = NAN;
    av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);
    crop->hsub = pix_desc->log2_chroma_w;
    crop->vsub = pix_desc->log2_chroma_h;
    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),
                                      var_names, crop->var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->oh_expr),
                                      var_names, crop->var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
    crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),
                                      var_names, crop->var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;
    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;
    if (normalize_double(&crop->w, crop->var_values[VAR_OUT_W]) < 0 ||
        normalize_double(&crop->h, crop->var_values[VAR_OUT_H]) < 0) {
        av_log(ctx, AV_LOG_ERROR,
               "Too big value or invalid expression for out_w/ow or out_h/oh. "
               "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
               crop->ow_expr, crop->oh_expr);
        return AVERROR(EINVAL);
    }
    crop->w &= ~((1 << crop->hsub) - 1);
    crop->h &= ~((1 << crop->vsub) - 1);
    if ((ret = av_expr_parse(&crop->x_pexpr, crop->x_expr, var_names,
                             NULL, NULL, NULL, NULL, 0, ctx)) < 0 ||
        (ret = av_expr_parse(&crop->y_pexpr, crop->y_expr, var_names,
                             NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        return AVERROR(EINVAL);
    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d\n",
           link->w, link->h, crop->w, crop->h);
    if (crop->w <= 0 || crop->h <= 0 ||
        crop->w > link->w || crop->h > link->h) {
        av_log(ctx, AV_LOG_ERROR,
               "Invalid too big or non positive size for width '%d' or height '%d'\n",
               crop->w, crop->h);
        return AVERROR(EINVAL);
    }
    crop->x = (link->w - crop->w) / 2;
    crop->y = (link->h - crop->h) / 2;
    crop->x &= ~((1 << crop->hsub) - 1);
    crop->y &= ~((1 << crop->vsub) - 1);
    return 0;
fail_expr:
    av_log(NULL, AV_LOG_ERROR, "Error when evaluating the expression '%s'\n", expr);
    return ret;
}
['static int config_input(AVFilterLink *link)\n{\n    AVFilterContext *ctx = link->dst;\n    CropContext *crop = ctx->priv;\n    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(link->format);\n    int ret;\n    const char *expr;\n    double res;\n    crop->var_values[VAR_E]     = M_E;\n    crop->var_values[VAR_PHI]   = M_PHI;\n    crop->var_values[VAR_PI]    = M_PI;\n    crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;\n    crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;\n    crop->var_values[VAR_X]     = NAN;\n    crop->var_values[VAR_Y]     = NAN;\n    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = NAN;\n    crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = NAN;\n    crop->var_values[VAR_N]     = 0;\n    crop->var_values[VAR_T]     = NAN;\n    crop->var_values[VAR_POS]   = NAN;\n    av_image_fill_max_pixsteps(crop->max_step, NULL, pix_desc);\n    crop->hsub = pix_desc->log2_chroma_w;\n    crop->vsub = pix_desc->log2_chroma_h;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),\n                                      var_names, crop->var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;\n    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->oh_expr),\n                                      var_names, crop->var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;\n    crop->var_values[VAR_OUT_H] = crop->var_values[VAR_OH] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = crop->ow_expr),\n                                      var_names, crop->var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0) goto fail_expr;\n    crop->var_values[VAR_OUT_W] = crop->var_values[VAR_OW] = res;\n    if (normalize_double(&crop->w, crop->var_values[VAR_OUT_W]) < 0 ||\n        normalize_double(&crop->h, crop->var_values[VAR_OUT_H]) < 0) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Too big value or invalid expression for out_w/ow or out_h/oh. "\n               "Maybe the expression for out_w:\'%s\' or for out_h:\'%s\' is self-referencing.\\n",\n               crop->ow_expr, crop->oh_expr);\n        return AVERROR(EINVAL);\n    }\n    crop->w &= ~((1 << crop->hsub) - 1);\n    crop->h &= ~((1 << crop->vsub) - 1);\n    if ((ret = av_expr_parse(&crop->x_pexpr, crop->x_expr, var_names,\n                             NULL, NULL, NULL, NULL, 0, ctx)) < 0 ||\n        (ret = av_expr_parse(&crop->y_pexpr, crop->y_expr, var_names,\n                             NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        return AVERROR(EINVAL);\n    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d\\n",\n           link->w, link->h, crop->w, crop->h);\n    if (crop->w <= 0 || crop->h <= 0 ||\n        crop->w > link->w || crop->h > link->h) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Invalid too big or non positive size for width \'%d\' or height \'%d\'\\n",\n               crop->w, crop->h);\n        return AVERROR(EINVAL);\n    }\n    crop->x = (link->w - crop->w) / 2;\n    crop->y = (link->h - crop->h) / 2;\n    crop->x &= ~((1 << crop->hsub) - 1);\n    crop->y &= ~((1 << crop->vsub) - 1);\n    return 0;\nfail_expr:\n    av_log(NULL, AV_LOG_ERROR, "Error when evaluating the expression \'%s\'\\n", expr);\n    return ret;\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}']