libavcodec/imgconvert.c:45: error: Null Dereference
  pointer `desc` last assigned on line 44 could be null and is dereferenced at line 45, column 16.

libavcodec/imgconvert.c:42:1: start of procedure avcodec_get_chroma_sub_sample()
40. #include "libavutil/imgutils.h"
41. 
42. void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
    ^
43. {
44.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);

libavcodec/imgconvert.c:44:5: 
42. void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
43. {
44.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
        ^
45.     *h_shift = desc->log2_chroma_w;
46.     *v_shift = desc->log2_chroma_h;

libavutil/pixdesc.c:1574:1: start of procedure av_pix_fmt_desc_get()
  1572. }
  1573. 
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1576:9: Taking false branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1576:24: Taking true branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1577:9: 
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1577.         return NULL;
                ^
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }

libavutil/pixdesc.c:1579:1: return from a call to av_pix_fmt_desc_get
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }
        ^
  1580. 
  1581. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/imgconvert.c:45:5: 
43. {
44.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
45.     *h_shift = desc->log2_chroma_w;
        ^
46.     *v_shift = desc->log2_chroma_h;
47. }

void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
{
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
    *h_shift = desc->log2_chroma_w;
    *v_shift = desc->log2_chroma_h;
}
['void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)\n{\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);\n    *h_shift = desc->log2_chroma_w;\n    *v_shift = desc->log2_chroma_h;\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}']