libavfilter/vf_pad.c:146: error: Null Dereference
  pointer `pix_desc` last assigned on line 140 could be null and is dereferenced at line 146, column 17.

libavfilter/vf_pad.c:136:1: start of procedure config_input()
134. }
135. 
136. static int config_input(AVFilterLink *inlink)
     ^
137. {
138.     AVFilterContext *ctx = inlink->dst;

libavfilter/vf_pad.c:138:5: 
136. static int config_input(AVFilterLink *inlink)
137. {
138.     AVFilterContext *ctx = inlink->dst;
         ^
139.     PadContext *pad = ctx->priv;
140.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);

libavfilter/vf_pad.c:139:5: 
137. {
138.     AVFilterContext *ctx = inlink->dst;
139.     PadContext *pad = ctx->priv;
         ^
140.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
141.     uint8_t rgba_color[4];

libavfilter/vf_pad.c:140:5: 
138.     AVFilterContext *ctx = inlink->dst;
139.     PadContext *pad = ctx->priv;
140.     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
         ^
141.     uint8_t rgba_color[4];
142.     int ret, is_packed_rgba;

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_pad.c:146:5: 
144.     char *expr;
145. 
146.     pad->hsub = pix_desc->log2_chroma_w;
         ^
147.     pad->vsub = pix_desc->log2_chroma_h;
148. 

static int config_input(AVFilterLink *inlink)
{
    AVFilterContext *ctx = inlink->dst;
    PadContext *pad = ctx->priv;
    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
    uint8_t rgba_color[4];
    int ret, is_packed_rgba;
    double var_values[VARS_NB], res;
    char *expr;
    pad->hsub = pix_desc->log2_chroma_w;
    pad->vsub = pix_desc->log2_chroma_h;
    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_HSUB]  = 1<<pad->hsub;
    var_values[VAR_VSUB]  = 1<<pad->vsub;
    av_expr_parse_and_eval(&res, (expr = pad->w_expr),
                           var_names, var_values,
                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
    pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->h_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    pad->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->w_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
    av_expr_parse_and_eval(&res, (expr = pad->x_expr),
                           var_names, var_values,
                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
    pad->x = var_values[VAR_X] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->y_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    pad->y = var_values[VAR_Y] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->x_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    pad->x = var_values[VAR_X] = res;
    if (pad->w < 0 || pad->h < 0 || pad->x < 0 || pad->y < 0) {
        av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\n");
        return AVERROR(EINVAL);
    }
    if (!pad->w)
        pad->w = inlink->w;
    if (!pad->h)
        pad->h = inlink->h;
    pad->w &= ~((1 << pad->hsub) - 1);
    pad->h &= ~((1 << pad->vsub) - 1);
    pad->x &= ~((1 << pad->hsub) - 1);
    pad->y &= ~((1 << pad->vsub) - 1);
    pad->in_w = inlink->w & ~((1 << pad->hsub) - 1);
    pad->in_h = inlink->h & ~((1 << pad->vsub) - 1);
    memcpy(rgba_color, pad->color, sizeof(rgba_color));
    ff_fill_line_with_color(pad->line, pad->line_step, pad->w, pad->color,
                            inlink->format, rgba_color, &is_packed_rgba, NULL);
    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\n",
           inlink->w, inlink->h, pad->w, pad->h, pad->x, pad->y,
           pad->color[0], pad->color[1], pad->color[2], pad->color[3],
           is_packed_rgba ? "rgba" : "yuva");
    if (pad->x <  0 || pad->y <  0                      ||
        pad->w <= 0 || pad->h <= 0                      ||
        (unsigned)pad->x + (unsigned)inlink->w > pad->w ||
        (unsigned)pad->y + (unsigned)inlink->h > pad->h) {
        av_log(ctx, AV_LOG_ERROR,
               "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\n",
               pad->x, pad->y, pad->x + inlink->w, pad->y + inlink->h, pad->w, pad->h);
        return AVERROR(EINVAL);
    }
    return 0;
eval_fail:
    av_log(NULL, AV_LOG_ERROR,
           "Error when evaluating the expression '%s'\n", expr);
    return ret;
}
['static int config_input(AVFilterLink *inlink)\n{\n    AVFilterContext *ctx = inlink->dst;\n    PadContext *pad = ctx->priv;\n    const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);\n    uint8_t rgba_color[4];\n    int ret, is_packed_rgba;\n    double var_values[VARS_NB], res;\n    char *expr;\n    pad->hsub = pix_desc->log2_chroma_w;\n    pad->vsub = pix_desc->log2_chroma_h;\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_HSUB]  = 1<<pad->hsub;\n    var_values[VAR_VSUB]  = 1<<pad->vsub;\n    av_expr_parse_and_eval(&res, (expr = pad->w_expr),\n                           var_names, var_values,\n                           NULL, NULL, NULL, NULL, NULL, 0, ctx);\n    pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->h_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    pad->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->w_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    pad->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;\n    av_expr_parse_and_eval(&res, (expr = pad->x_expr),\n                           var_names, var_values,\n                           NULL, NULL, NULL, NULL, NULL, 0, ctx);\n    pad->x = var_values[VAR_X] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->y_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    pad->y = var_values[VAR_Y] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = pad->x_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    pad->x = var_values[VAR_X] = res;\n    if (pad->w < 0 || pad->h < 0 || pad->x < 0 || pad->y < 0) {\n        av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\\n");\n        return AVERROR(EINVAL);\n    }\n    if (!pad->w)\n        pad->w = inlink->w;\n    if (!pad->h)\n        pad->h = inlink->h;\n    pad->w &= ~((1 << pad->hsub) - 1);\n    pad->h &= ~((1 << pad->vsub) - 1);\n    pad->x &= ~((1 << pad->hsub) - 1);\n    pad->y &= ~((1 << pad->vsub) - 1);\n    pad->in_w = inlink->w & ~((1 << pad->hsub) - 1);\n    pad->in_h = inlink->h & ~((1 << pad->vsub) - 1);\n    memcpy(rgba_color, pad->color, sizeof(rgba_color));\n    ff_fill_line_with_color(pad->line, pad->line_step, pad->w, pad->color,\n                            inlink->format, rgba_color, &is_packed_rgba, NULL);\n    av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d -> w:%d h:%d x:%d y:%d color:0x%02X%02X%02X%02X[%s]\\n",\n           inlink->w, inlink->h, pad->w, pad->h, pad->x, pad->y,\n           pad->color[0], pad->color[1], pad->color[2], pad->color[3],\n           is_packed_rgba ? "rgba" : "yuva");\n    if (pad->x <  0 || pad->y <  0                      ||\n        pad->w <= 0 || pad->h <= 0                      ||\n        (unsigned)pad->x + (unsigned)inlink->w > pad->w ||\n        (unsigned)pad->y + (unsigned)inlink->h > pad->h) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Input area %d:%d:%d:%d not within the padded area 0:0:%d:%d or zero-sized\\n",\n               pad->x, pad->y, pad->x + inlink->w, pad->y + inlink->h, pad->w, pad->h);\n        return AVERROR(EINVAL);\n    }\n    return 0;\neval_fail:\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}']