libavfilter/vf_lut.c:204: error: Null Dereference
  pointer `desc` last assigned on line 200 could be null and is dereferenced at line 204, column 15.

libavfilter/vf_lut.c:196:1: start of procedure config_props()
194. };
195. 
196. static int config_props(AVFilterLink *inlink)
     ^
197. {
198.     AVFilterContext *ctx = inlink->dst;

libavfilter/vf_lut.c:198:5: 
196. static int config_props(AVFilterLink *inlink)
197. {
198.     AVFilterContext *ctx = inlink->dst;
         ^
199.     LutContext *s = ctx->priv;
200.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);

libavfilter/vf_lut.c:199:5: 
197. {
198.     AVFilterContext *ctx = inlink->dst;
199.     LutContext *s = ctx->priv;
         ^
200.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
201.     int min[4], max[4];

libavfilter/vf_lut.c:200:5: 
198.     AVFilterContext *ctx = inlink->dst;
199.     LutContext *s = ctx->priv;
200.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
         ^
201.     int min[4], max[4];
202.     int val, comp, ret;

libavutil/pixdesc.c:1464:1: start of procedure av_pix_fmt_desc_get()
  1462. }
  1463. 
  1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1465. {
  1466.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1466:9: Taking false branch
  1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1465. {
  1466.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1467.         return NULL;
  1468.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1466:24: Taking true branch
  1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1465. {
  1466.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1467.         return NULL;
  1468.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1467:9: 
  1465. {
  1466.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1467.         return NULL;
                ^
  1468.     return &av_pix_fmt_descriptors[pix_fmt];
  1469. }

libavutil/pixdesc.c:1469:1: return from a call to av_pix_fmt_desc_get
  1467.         return NULL;
  1468.     return &av_pix_fmt_descriptors[pix_fmt];
  1469. }
        ^
  1470. 
  1471. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/vf_lut.c:204:5: 
202.     int val, comp, ret;
203. 
204.     s->hsub = desc->log2_chroma_w;
         ^
205.     s->vsub = desc->log2_chroma_h;
206. 

static int config_props(AVFilterLink *inlink)
{
    AVFilterContext *ctx = inlink->dst;
    LutContext *s = ctx->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    int min[4], max[4];
    int val, comp, ret;
    s->hsub = desc->log2_chroma_w;
    s->vsub = desc->log2_chroma_h;
    s->var_values[VAR_W] = inlink->w;
    s->var_values[VAR_H] = inlink->h;
    switch (inlink->format) {
    case AV_PIX_FMT_YUV410P:
    case AV_PIX_FMT_YUV411P:
    case AV_PIX_FMT_YUV420P:
    case AV_PIX_FMT_YUV422P:
    case AV_PIX_FMT_YUV440P:
    case AV_PIX_FMT_YUV444P:
    case AV_PIX_FMT_YUVA420P:
        min[Y] = min[U] = min[V] = 16;
        max[Y] = 235;
        max[U] = max[V] = 240;
        min[A] = 0; max[A] = 255;
        break;
    default:
        min[0] = min[1] = min[2] = min[3] = 0;
        max[0] = max[1] = max[2] = max[3] = 255;
    }
    s->is_yuv = s->is_rgb = 0;
    if      (ff_fmt_is_in(inlink->format, yuv_pix_fmts)) s->is_yuv = 1;
    else if (ff_fmt_is_in(inlink->format, rgb_pix_fmts)) s->is_rgb = 1;
    if (s->is_rgb) {
        switch (inlink->format) {
        case AV_PIX_FMT_ARGB:  s->rgba_map[A] = 0; s->rgba_map[R] = 1; s->rgba_map[G] = 2; s->rgba_map[B] = 3; break;
        case AV_PIX_FMT_ABGR:  s->rgba_map[A] = 0; s->rgba_map[B] = 1; s->rgba_map[G] = 2; s->rgba_map[R] = 3; break;
        case AV_PIX_FMT_RGBA:
        case AV_PIX_FMT_RGB24: s->rgba_map[R] = 0; s->rgba_map[G] = 1; s->rgba_map[B] = 2; s->rgba_map[A] = 3; break;
        case AV_PIX_FMT_BGRA:
        case AV_PIX_FMT_BGR24: s->rgba_map[B] = 0; s->rgba_map[G] = 1; s->rgba_map[R] = 2; s->rgba_map[A] = 3; break;
        }
        s->step = av_get_bits_per_pixel(desc) >> 3;
    }
    for (comp = 0; comp < desc->nb_components; comp++) {
        double res;
        ret = av_expr_parse(&s->comp_expr[comp], s->comp_expr_str[comp],
                            var_names, funcs1_names, funcs1, NULL, NULL, 0, ctx);
        if (ret < 0) {
            av_log(ctx, AV_LOG_ERROR,
                   "Error when parsing the expression '%s' for the component %d.\n",
                   s->comp_expr_str[comp], comp);
            return AVERROR(EINVAL);
        }
        s->var_values[VAR_MAXVAL] = max[comp];
        s->var_values[VAR_MINVAL] = min[comp];
        for (val = 0; val < 256; val++) {
            s->var_values[VAR_VAL] = val;
            s->var_values[VAR_CLIPVAL] = av_clip(val, min[comp], max[comp]);
            s->var_values[VAR_NEGVAL] =
                av_clip(min[comp] + max[comp] - s->var_values[VAR_VAL],
                        min[comp], max[comp]);
            res = av_expr_eval(s->comp_expr[comp], s->var_values, s);
            if (isnan(res)) {
                av_log(ctx, AV_LOG_ERROR,
                       "Error when evaluating the expression '%s' for the value %d for the component #%d.\n",
                       s->comp_expr_str[comp], val, comp);
                return AVERROR(EINVAL);
            }
            s->lut[comp][val] = av_clip((int)res, min[comp], max[comp]);
            av_log(ctx, AV_LOG_DEBUG, "val[%d][%d] = %d\n", comp, val, s->lut[comp][val]);
        }
    }
    return 0;
}
['static int config_props(AVFilterLink *inlink)\n{\n    AVFilterContext *ctx = inlink->dst;\n    LutContext *s = ctx->priv;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);\n    int min[4], max[4];\n    int val, comp, ret;\n    s->hsub = desc->log2_chroma_w;\n    s->vsub = desc->log2_chroma_h;\n    s->var_values[VAR_W] = inlink->w;\n    s->var_values[VAR_H] = inlink->h;\n    switch (inlink->format) {\n    case AV_PIX_FMT_YUV410P:\n    case AV_PIX_FMT_YUV411P:\n    case AV_PIX_FMT_YUV420P:\n    case AV_PIX_FMT_YUV422P:\n    case AV_PIX_FMT_YUV440P:\n    case AV_PIX_FMT_YUV444P:\n    case AV_PIX_FMT_YUVA420P:\n        min[Y] = min[U] = min[V] = 16;\n        max[Y] = 235;\n        max[U] = max[V] = 240;\n        min[A] = 0; max[A] = 255;\n        break;\n    default:\n        min[0] = min[1] = min[2] = min[3] = 0;\n        max[0] = max[1] = max[2] = max[3] = 255;\n    }\n    s->is_yuv = s->is_rgb = 0;\n    if      (ff_fmt_is_in(inlink->format, yuv_pix_fmts)) s->is_yuv = 1;\n    else if (ff_fmt_is_in(inlink->format, rgb_pix_fmts)) s->is_rgb = 1;\n    if (s->is_rgb) {\n        switch (inlink->format) {\n        case AV_PIX_FMT_ARGB:  s->rgba_map[A] = 0; s->rgba_map[R] = 1; s->rgba_map[G] = 2; s->rgba_map[B] = 3; break;\n        case AV_PIX_FMT_ABGR:  s->rgba_map[A] = 0; s->rgba_map[B] = 1; s->rgba_map[G] = 2; s->rgba_map[R] = 3; break;\n        case AV_PIX_FMT_RGBA:\n        case AV_PIX_FMT_RGB24: s->rgba_map[R] = 0; s->rgba_map[G] = 1; s->rgba_map[B] = 2; s->rgba_map[A] = 3; break;\n        case AV_PIX_FMT_BGRA:\n        case AV_PIX_FMT_BGR24: s->rgba_map[B] = 0; s->rgba_map[G] = 1; s->rgba_map[R] = 2; s->rgba_map[A] = 3; break;\n        }\n        s->step = av_get_bits_per_pixel(desc) >> 3;\n    }\n    for (comp = 0; comp < desc->nb_components; comp++) {\n        double res;\n        ret = av_expr_parse(&s->comp_expr[comp], s->comp_expr_str[comp],\n                            var_names, funcs1_names, funcs1, NULL, NULL, 0, ctx);\n        if (ret < 0) {\n            av_log(ctx, AV_LOG_ERROR,\n                   "Error when parsing the expression \'%s\' for the component %d.\\n",\n                   s->comp_expr_str[comp], comp);\n            return AVERROR(EINVAL);\n        }\n        s->var_values[VAR_MAXVAL] = max[comp];\n        s->var_values[VAR_MINVAL] = min[comp];\n        for (val = 0; val < 256; val++) {\n            s->var_values[VAR_VAL] = val;\n            s->var_values[VAR_CLIPVAL] = av_clip(val, min[comp], max[comp]);\n            s->var_values[VAR_NEGVAL] =\n                av_clip(min[comp] + max[comp] - s->var_values[VAR_VAL],\n                        min[comp], max[comp]);\n            res = av_expr_eval(s->comp_expr[comp], s->var_values, s);\n            if (isnan(res)) {\n                av_log(ctx, AV_LOG_ERROR,\n                       "Error when evaluating the expression \'%s\' for the value %d for the component #%d.\\n",\n                       s->comp_expr_str[comp], val, comp);\n                return AVERROR(EINVAL);\n            }\n            s->lut[comp][val] = av_clip((int)res, min[comp], max[comp]);\n            av_log(ctx, AV_LOG_DEBUG, "val[%d][%d] = %d\\n", comp, val, s->lut[comp][val]);\n        }\n    }\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}']