libavcodec/hevc.c:2709: error: Null Dereference
  pointer `desc` last assigned on line 2708 could be null and is dereferenced at line 2709, column 23.

libavcodec/hevc.c:2706:1: start of procedure verify_md5()
2704. }
2705. 
2706. static int verify_md5(HEVCContext *s, AVFrame *frame)
      ^
2707. {
2708.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);

libavcodec/hevc.c:2708:5: 
2706. static int verify_md5(HEVCContext *s, AVFrame *frame)
2707. {
2708.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
          ^
2709.     int pixel_shift = desc->comp[0].depth_minus1 > 7;
2710.     int i, j;

libavutil/pixdesc.c:1504:1: start of procedure av_pix_fmt_desc_get()
  1502. }
  1503. 
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1506:9: Taking false branch
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1506:24: Taking true branch
  1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1507:9: 
  1505. {
  1506.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1507.         return NULL;
                ^
  1508.     return &av_pix_fmt_descriptors[pix_fmt];
  1509. }

libavutil/pixdesc.c:1509:1: return from a call to av_pix_fmt_desc_get
  1507.         return NULL;
  1508.     return &av_pix_fmt_descriptors[pix_fmt];
  1509. }
        ^
  1510. 
  1511. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/hevc.c:2709:23: 
2707. {
2708.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
2709.     int pixel_shift = desc->comp[0].depth_minus1 > 7;
                            ^
2710.     int i, j;
2711. 

static int verify_md5(HEVCContext *s, AVFrame *frame)
{
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
    int pixel_shift = desc->comp[0].depth_minus1 > 7;
    int i, j;
    if (!desc)
        return AVERROR(EINVAL);
    av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ",
           s->poc);
#if HAVE_BIGENDIAN
    if (pixel_shift && !s->checksum_buf) {
        av_fast_malloc(&s->checksum_buf, &s->checksum_buf_size,
                       FFMAX3(frame->linesize[0], frame->linesize[1],
                              frame->linesize[2]));
        if (!s->checksum_buf)
            return AVERROR(ENOMEM);
    }
#endif
    for (i = 0; frame->data[i]; i++) {
        int width  = s->avctx->coded_width;
        int height = s->avctx->coded_height;
        int w = (i == 1 || i == 2) ? (width  >> desc->log2_chroma_w) : width;
        int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height;
        uint8_t md5[16];
        av_md5_init(s->md5_ctx);
        for (j = 0; j < h; j++) {
            const uint8_t *src = frame->data[i] + j * frame->linesize[i];
#if HAVE_BIGENDIAN
            if (pixel_shift) {
                s->dsp.bswap16_buf((uint16_t*)s->checksum_buf,
                                   (const uint16_t*)src, w);
                src = s->checksum_buf;
            }
#endif
            av_md5_update(s->md5_ctx, src, w << pixel_shift);
        }
        av_md5_final(s->md5_ctx, md5);
        if (!memcmp(md5, s->md5[i], 16)) {
            av_log   (s->avctx, AV_LOG_DEBUG, "plane %d - correct ", i);
            print_md5(s->avctx, AV_LOG_DEBUG, md5);
            av_log   (s->avctx, AV_LOG_DEBUG, "; ");
        } else {
            av_log   (s->avctx, AV_LOG_ERROR, "mismatching checksum of plane %d - ", i);
            print_md5(s->avctx, AV_LOG_ERROR, md5);
            av_log   (s->avctx, AV_LOG_ERROR, " != ");
            print_md5(s->avctx, AV_LOG_ERROR, s->md5[i]);
            av_log   (s->avctx, AV_LOG_ERROR, "\n");
            return AVERROR_INVALIDDATA;
        }
    }
    av_log(s->avctx, AV_LOG_DEBUG, "\n");
    return 0;
}
['static int verify_md5(HEVCContext *s, AVFrame *frame)\n{\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);\n    int pixel_shift = desc->comp[0].depth_minus1 > 7;\n    int i, j;\n    if (!desc)\n        return AVERROR(EINVAL);\n    av_log(s->avctx, AV_LOG_DEBUG, "Verifying checksum for frame with POC %d: ",\n           s->poc);\n#if HAVE_BIGENDIAN\n    if (pixel_shift && !s->checksum_buf) {\n        av_fast_malloc(&s->checksum_buf, &s->checksum_buf_size,\n                       FFMAX3(frame->linesize[0], frame->linesize[1],\n                              frame->linesize[2]));\n        if (!s->checksum_buf)\n            return AVERROR(ENOMEM);\n    }\n#endif\n    for (i = 0; frame->data[i]; i++) {\n        int width  = s->avctx->coded_width;\n        int height = s->avctx->coded_height;\n        int w = (i == 1 || i == 2) ? (width  >> desc->log2_chroma_w) : width;\n        int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height;\n        uint8_t md5[16];\n        av_md5_init(s->md5_ctx);\n        for (j = 0; j < h; j++) {\n            const uint8_t *src = frame->data[i] + j * frame->linesize[i];\n#if HAVE_BIGENDIAN\n            if (pixel_shift) {\n                s->dsp.bswap16_buf((uint16_t*)s->checksum_buf,\n                                   (const uint16_t*)src, w);\n                src = s->checksum_buf;\n            }\n#endif\n            av_md5_update(s->md5_ctx, src, w << pixel_shift);\n        }\n        av_md5_final(s->md5_ctx, md5);\n        if (!memcmp(md5, s->md5[i], 16)) {\n            av_log   (s->avctx, AV_LOG_DEBUG, "plane %d - correct ", i);\n            print_md5(s->avctx, AV_LOG_DEBUG, md5);\n            av_log   (s->avctx, AV_LOG_DEBUG, "; ");\n        } else {\n            av_log   (s->avctx, AV_LOG_ERROR, "mismatching checksum of plane %d - ", i);\n            print_md5(s->avctx, AV_LOG_ERROR, md5);\n            av_log   (s->avctx, AV_LOG_ERROR, " != ");\n            print_md5(s->avctx, AV_LOG_ERROR, s->md5[i]);\n            av_log   (s->avctx, AV_LOG_ERROR, "\\n");\n            return AVERROR_INVALIDDATA;\n        }\n    }\n    av_log(s->avctx, AV_LOG_DEBUG, "\\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}']