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

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

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

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

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

libavutil/pixdesc.c:1703:1: start of procedure av_pix_fmt_desc_get()
  1701. }
  1702. 
  1703. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1704. {
  1705.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1705:9: Taking false branch
  1703. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1704. {
  1705.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1706.         return NULL;
  1707.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1705:24: Taking true branch
  1703. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1704. {
  1705.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1706.         return NULL;
  1707.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1706:9: 
  1704. {
  1705.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1706.         return NULL;
                ^
  1707.     return &av_pix_fmt_descriptors[pix_fmt];
  1708. }

libavutil/pixdesc.c:1708:1: return from a call to av_pix_fmt_desc_get
  1706.         return NULL;
  1707.     return &av_pix_fmt_descriptors[pix_fmt];
  1708. }
        ^
  1709. 
  1710. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavfilter/vf_pad.c:145:5: 
143.     char *expr;
144. 
145.     s->hsub = pix_desc->log2_chroma_w;
         ^
146.     s->vsub = pix_desc->log2_chroma_h;
147. 

static int config_input(AVFilterLink *inlink)
{
    AVFilterContext *ctx = inlink->dst;
    PadContext *s = 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;
    s->hsub = pix_desc->log2_chroma_w;
    s->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<<s->hsub;
    var_values[VAR_VSUB]  = 1<<s->vsub;
    av_expr_parse_and_eval(&res, (expr = s->w_expr),
                           var_names, var_values,
                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
    if (!s->h)
        var_values[VAR_OUT_H] = var_values[VAR_OH] = s->h = inlink->h;
    if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
    if (!s->w)
        var_values[VAR_OUT_W] = var_values[VAR_OW] = s->w = inlink->w;
    av_expr_parse_and_eval(&res, (expr = s->x_expr),
                           var_names, var_values,
                           NULL, NULL, NULL, NULL, NULL, 0, ctx);
    s->x = var_values[VAR_X] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = s->y_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    s->y = var_values[VAR_Y] = res;
    if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr),
                                      var_names, var_values,
                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
        goto eval_fail;
    s->x = var_values[VAR_X] = res;
    if (s->w < 0 || s->h < 0 || s->x < 0 || s->y < 0) {
        av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\n");
        return AVERROR(EINVAL);
    }
    s->w &= ~((1 << s->hsub) - 1);
    s->h &= ~((1 << s->vsub) - 1);
    s->x &= ~((1 << s->hsub) - 1);
    s->y &= ~((1 << s->vsub) - 1);
    s->in_w = inlink->w & ~((1 << s->hsub) - 1);
    s->in_h = inlink->h & ~((1 << s->vsub) - 1);
    memcpy(rgba_color, s->color, sizeof(rgba_color));
    ff_fill_line_with_color(s->line, s->line_step, s->w, s->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, s->w, s->h, s->x, s->y,
           s->color[0], s->color[1], s->color[2], s->color[3],
           is_packed_rgba ? "rgba" : "yuva");
    if (s->x <  0 || s->y <  0                      ||
        s->w <= 0 || s->h <= 0                      ||
        (unsigned)s->x + (unsigned)inlink->w > s->w ||
        (unsigned)s->y + (unsigned)inlink->h > s->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",
               s->x, s->y, s->x + inlink->w, s->y + inlink->h, s->w, s->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 *s = 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    s->hsub = pix_desc->log2_chroma_w;\n    s->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<<s->hsub;\n    var_values[VAR_VSUB]  = 1<<s->vsub;\n    av_expr_parse_and_eval(&res, (expr = s->w_expr),\n                           var_names, var_values,\n                           NULL, NULL, NULL, NULL, NULL, 0, ctx);\n    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = s->h_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    s->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;\n    if (!s->h)\n        var_values[VAR_OUT_H] = var_values[VAR_OH] = s->h = inlink->h;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    s->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;\n    if (!s->w)\n        var_values[VAR_OUT_W] = var_values[VAR_OW] = s->w = inlink->w;\n    av_expr_parse_and_eval(&res, (expr = s->x_expr),\n                           var_names, var_values,\n                           NULL, NULL, NULL, NULL, NULL, 0, ctx);\n    s->x = var_values[VAR_X] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = s->y_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    s->y = var_values[VAR_Y] = res;\n    if ((ret = av_expr_parse_and_eval(&res, (expr = s->x_expr),\n                                      var_names, var_values,\n                                      NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)\n        goto eval_fail;\n    s->x = var_values[VAR_X] = res;\n    if (s->w < 0 || s->h < 0 || s->x < 0 || s->y < 0) {\n        av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\\n");\n        return AVERROR(EINVAL);\n    }\n    s->w &= ~((1 << s->hsub) - 1);\n    s->h &= ~((1 << s->vsub) - 1);\n    s->x &= ~((1 << s->hsub) - 1);\n    s->y &= ~((1 << s->vsub) - 1);\n    s->in_w = inlink->w & ~((1 << s->hsub) - 1);\n    s->in_h = inlink->h & ~((1 << s->vsub) - 1);\n    memcpy(rgba_color, s->color, sizeof(rgba_color));\n    ff_fill_line_with_color(s->line, s->line_step, s->w, s->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, s->w, s->h, s->x, s->y,\n           s->color[0], s->color[1], s->color[2], s->color[3],\n           is_packed_rgba ? "rgba" : "yuva");\n    if (s->x <  0 || s->y <  0                      ||\n        s->w <= 0 || s->h <= 0                      ||\n        (unsigned)s->x + (unsigned)inlink->w > s->w ||\n        (unsigned)s->y + (unsigned)inlink->h > s->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               s->x, s->y, s->x + inlink->w, s->y + inlink->h, s->w, s->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}']