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

libavfilter/vf_scale.c:154:1: start of procedure config_props()
152. }
153. 
154. static int config_props(AVFilterLink *outlink)
     ^
155. {
156.     AVFilterContext *ctx = outlink->src;

libavfilter/vf_scale.c:156:5: 
154. static int config_props(AVFilterLink *outlink)
155. {
156.     AVFilterContext *ctx = outlink->src;
         ^
157.     AVFilterLink *inlink = outlink->src->inputs[0];
158.     ScaleContext *scale = ctx->priv;

libavfilter/vf_scale.c:157:5: 
155. {
156.     AVFilterContext *ctx = outlink->src;
157.     AVFilterLink *inlink = outlink->src->inputs[0];
         ^
158.     ScaleContext *scale = ctx->priv;
159.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);

libavfilter/vf_scale.c:158:5: 
156.     AVFilterContext *ctx = outlink->src;
157.     AVFilterLink *inlink = outlink->src->inputs[0];
158.     ScaleContext *scale = ctx->priv;
         ^
159.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
160.     int64_t w, h;

libavfilter/vf_scale.c:159:5: 
157.     AVFilterLink *inlink = outlink->src->inputs[0];
158.     ScaleContext *scale = ctx->priv;
159.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
         ^
160.     int64_t w, h;
161.     double var_values[VARS_NB], res;

libavutil/pixdesc.c:1574:1: start of procedure av_pix_fmt_desc_get()
  1572. }
  1573. 
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1576:9: Taking false branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1576:24: Taking true branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1577:9: 
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1577.         return NULL;
                ^
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }

libavutil/pixdesc.c:1579:1: return from a call to av_pix_fmt_desc_get
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }
        ^
  1580. 
  1581. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/vf_scale.c:165:5: 
163.     int ret;
164. 
165.     var_values[VAR_PI]    = M_PI;
         ^
166.     var_values[VAR_PHI]   = M_PHI;
167.     var_values[VAR_E]     = M_E;

libavfilter/vf_scale.c:166:5: 
164. 
165.     var_values[VAR_PI]    = M_PI;
166.     var_values[VAR_PHI]   = M_PHI;
         ^
167.     var_values[VAR_E]     = M_E;
168.     var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;

libavfilter/vf_scale.c:167:5: 
165.     var_values[VAR_PI]    = M_PI;
166.     var_values[VAR_PHI]   = M_PHI;
167.     var_values[VAR_E]     = M_E;
         ^
168.     var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
169.     var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;

libavfilter/vf_scale.c:168:5: 
166.     var_values[VAR_PHI]   = M_PHI;
167.     var_values[VAR_E]     = M_E;
168.     var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
         ^
169.     var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
170.     var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;

libavfilter/vf_scale.c:169:5: 
167.     var_values[VAR_E]     = M_E;
168.     var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
169.     var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
         ^
170.     var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;

libavfilter/vf_scale.c:170:5: Skipping __builtin_nanf(): method has no implementation
168.     var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
169.     var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
170.     var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
         ^
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
172.     var_values[VAR_A]     = (double) inlink->w / inlink->h;

libavfilter/vf_scale.c:171:5: Skipping __builtin_nanf(): method has no implementation
169.     var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
170.     var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
         ^
172.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
173.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?

libavfilter/vf_scale.c:172:5: 
170.     var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
172.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
         ^
173.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
174.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;

libavfilter/vf_scale.c:173:29: Condition is true
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
172.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
173.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
                                 ^
174.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
175.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];

libavfilter/vf_scale.c:173:5: 
171.     var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
172.     var_values[VAR_A]     = (double) inlink->w / inlink->h;
173.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
         ^
174.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
175.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];

libavfilter/vf_scale.c:175:5: 
173.     var_values[VAR_SAR]   = inlink->sample_aspect_ratio.num ?
174.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
175.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
         ^
176.     var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
177.     var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;

libavfilter/vf_scale.c:176:5: 
174.         (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
175.     var_values[VAR_DAR]   = var_values[VAR_A] * var_values[VAR_SAR];
176.     var_values[VAR_HSUB]  = 1 << desc->log2_chroma_w;
         ^
177.     var_values[VAR_VSUB]  = 1 << desc->log2_chroma_h;
178. 

static int config_props(AVFilterLink *outlink)
{
    AVFilterContext *ctx = outlink->src;
    AVFilterLink *inlink = outlink->src->inputs[0];
    ScaleContext *scale = ctx->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    int64_t w, h;
    double var_values[VARS_NB], res;
    char *expr;
    int ret;
    var_values[VAR_PI]    = M_PI;
    var_values[VAR_PHI]   = M_PHI;
    var_values[VAR_E]     = M_E;
    var_values[VAR_IN_W]  = var_values[VAR_IW] = inlink->w;
    var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;
    var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
    var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
    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;
    av_expr_parse_and_eval(&res, (expr = scale->w_expr),
                           var_names, var_values,
                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
    scale->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->h_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto fail;
    scale->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->w_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto fail;
    scale->w = res;
    w = scale->w;
    h = scale->h;
    if (w <  -1 || h <  -1) {
        av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\n");
        return AVERROR(EINVAL);
    }
    if (w == -1 && h == -1)
        scale->w = scale->h = 0;
    if (!(w = scale->w))
        w = inlink->w;
    if (!(h = scale->h))
        h = inlink->h;
    if (w == -1)
        w = av_rescale(h, inlink->w, inlink->h);
    if (h == -1)
        h = av_rescale(w, inlink->h, inlink->w);
    if (w > INT_MAX || h > INT_MAX ||
        (h * inlink->w) > INT_MAX  ||
        (w * inlink->h) > INT_MAX)
        av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n");
    outlink->w = w;
    outlink->h = h;
    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s -> w:%d h:%d fmt:%s flags:0x%0x\n",
           inlink ->w, inlink ->h, av_get_pix_fmt_name(inlink->format),
           outlink->w, outlink->h, av_get_pix_fmt_name(outlink->format),
           scale->flags);
    scale->input_is_pal = desc->flags & AV_PIX_FMT_FLAG_PAL ||
                          desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL;
    if (scale->sws)
        sws_freeContext(scale->sws);
    if (inlink->w == outlink->w && inlink->h == outlink->h &&
        inlink->format == outlink->format)
        scale->sws = NULL;
    else {
        scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
                                    outlink->w, outlink->h, outlink->format,
                                    scale->flags, NULL, NULL, NULL);
        if (!scale->sws)
            return AVERROR(EINVAL);
    }
    if (inlink->sample_aspect_ratio.num)
        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h*inlink->w,
                                                             outlink->w*inlink->h},
                                                inlink->sample_aspect_ratio);
    else
        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
    return 0;
fail:
    av_log(NULL, AV_LOG_ERROR,
           "Error when evaluating the expression '%s'\n", expr);
    return ret;
}
['static int config_props(AVFilterLink *outlink)\n{\n    AVFilterContext *ctx = outlink->src;\n    AVFilterLink *inlink = outlink->src->inputs[0];\n    ScaleContext *scale = ctx->priv;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);\n    int64_t w, h;\n    double var_values[VARS_NB], res;\n    char *expr;\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_IN_W]  = var_values[VAR_IW] = inlink->w;\n    var_values[VAR_IN_H]  = var_values[VAR_IH] = inlink->h;\n    var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;\n    var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;\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    av_expr_parse_and_eval(&res, (expr = scale->w_expr),\n                           var_names, var_values,\n                           NULL, NULL, NULL, NULL, NULL, 0, ctx);\n    scale->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->h_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto fail;\n    scale->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = scale->w_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto fail;\n    scale->w = res;\n    w = scale->w;\n    h = scale->h;\n    if (w <  -1 || h <  -1) {\n        av_log(ctx, AV_LOG_ERROR, "Size values less than -1 are not acceptable.\\n");\n        return AVERROR(EINVAL);\n    }\n    if (w == -1 && h == -1)\n        scale->w = scale->h = 0;\n    if (!(w = scale->w))\n        w = inlink->w;\n    if (!(h = scale->h))\n        h = inlink->h;\n    if (w == -1)\n        w = av_rescale(h, inlink->w, inlink->h);\n    if (h == -1)\n        h = av_rescale(w, inlink->h, inlink->w);\n    if (w > INT_MAX || h > INT_MAX ||\n        (h * inlink->w) > INT_MAX  ||\n        (w * inlink->h) > INT_MAX)\n        av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\\n");\n    outlink->w = w;\n    outlink->h = h;\n    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s -> w:%d h:%d fmt:%s flags:0x%0x\\n",\n           inlink ->w, inlink ->h, av_get_pix_fmt_name(inlink->format),\n           outlink->w, outlink->h, av_get_pix_fmt_name(outlink->format),\n           scale->flags);\n    scale->input_is_pal = desc->flags & AV_PIX_FMT_FLAG_PAL ||\n                          desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL;\n    if (scale->sws)\n        sws_freeContext(scale->sws);\n    if (inlink->w == outlink->w && inlink->h == outlink->h &&\n        inlink->format == outlink->format)\n        scale->sws = NULL;\n    else {\n        scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,\n                                    outlink->w, outlink->h, outlink->format,\n                                    scale->flags, NULL, NULL, NULL);\n        if (!scale->sws)\n            return AVERROR(EINVAL);\n    }\n    if (inlink->sample_aspect_ratio.num)\n        outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h*inlink->w,\n                                                             outlink->w*inlink->h},\n                                                inlink->sample_aspect_ratio);\n    else\n        outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;\n    return 0;\nfail:\n    av_log(NULL, AV_LOG_ERROR,\n           "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}']