libavfilter/vf_gradfun.c:166: error: Null Dereference
  pointer `desc` last assigned on line 165 could be null and is dereferenced at line 166, column 16.

libavfilter/vf_gradfun.c:162:1: start of procedure config_input()
160. }
161. 
162. static int config_input(AVFilterLink *inlink)
     ^
163. {
164.     GradFunContext *s = inlink->dst->priv;

libavfilter/vf_gradfun.c:164:5: 
162. static int config_input(AVFilterLink *inlink)
163. {
164.     GradFunContext *s = inlink->dst->priv;
         ^
165.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
166.     int hsub = desc->log2_chroma_w;

libavfilter/vf_gradfun.c:165:5: 
163. {
164.     GradFunContext *s = inlink->dst->priv;
165.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
         ^
166.     int hsub = desc->log2_chroma_w;
167.     int vsub = desc->log2_chroma_h;

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_gradfun.c:166:5: 
164.     GradFunContext *s = inlink->dst->priv;
165.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
166.     int hsub = desc->log2_chroma_w;
         ^
167.     int vsub = desc->log2_chroma_h;
168. 

static int config_input(AVFilterLink *inlink)
{
    GradFunContext *s = inlink->dst->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    int hsub = desc->log2_chroma_w;
    int vsub = desc->log2_chroma_h;
    s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t));
    if (!s->buf)
        return AVERROR(ENOMEM);
    s->chroma_w = -((-inlink->w) >> hsub);
    s->chroma_h = -((-inlink->h) >> vsub);
    s->chroma_r = av_clip(((((s->radius >> hsub) + (s->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32);
    return 0;
}
['static int config_input(AVFilterLink *inlink)\n{\n    GradFunContext *s = inlink->dst->priv;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);\n    int hsub = desc->log2_chroma_w;\n    int vsub = desc->log2_chroma_h;\n    s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t));\n    if (!s->buf)\n        return AVERROR(ENOMEM);\n    s->chroma_w = -((-inlink->w) >> hsub);\n    s->chroma_h = -((-inlink->h) >> vsub);\n    s->chroma_r = av_clip(((((s->radius >> hsub) + (s->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32);\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}']