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

libavcodec/imgconvert.c:465:1: start of procedure avpicture_get_size()
463. }
464. 
465. int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
     ^
466. {
467.     AVPicture dummy_pict;

libavcodec/imgconvert.c:468:5: 
466. {
467.     AVPicture dummy_pict;
468.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
         ^
469. 
470.     if(av_image_check_size(width, height, 0, NULL))

libavutil/pixdesc.c:1433:1: start of procedure av_pix_fmt_desc_get()
  1431. }
  1432. 
  1433. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1434. {
  1435.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1435:9: Taking false branch
  1433. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1434. {
  1435.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1436.         return NULL;
  1437.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1435:24: Taking true branch
  1433. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1434. {
  1435.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1436.         return NULL;
  1437.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1436:9: 
  1434. {
  1435.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1436.         return NULL;
                ^
  1437.     return &av_pix_fmt_descriptors[pix_fmt];
  1438. }

libavutil/pixdesc.c:1438:1: return from a call to av_pix_fmt_desc_get
  1436.         return NULL;
  1437.     return &av_pix_fmt_descriptors[pix_fmt];
  1438. }
        ^
  1439. 
  1440. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/imgconvert.c:470:8: 
468.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
469. 
470.     if(av_image_check_size(width, height, 0, NULL))
            ^
471.         return -1;
472.     if (desc->flags & PIX_FMT_PSEUDOPAL)

libavutil/imgutils.c:220:1: start of procedure av_image_check_size()
  218. static const AVClass imgutils_class = { "IMGUTILS", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(ImgUtils, log_offset), offsetof(ImgUtils, log_ctx) };
  219. 
  220. int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
       ^
  221. {
  222.     ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };

libavutil/imgutils.c:222:5: 
  220. int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
  221. {
  222.     ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };
           ^
  223. 
  224.     if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)

libavutil/imgutils.c:224:9: Taking true branch
  222.     ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };
  223. 
  224.     if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
               ^
  225.         return 0;
  226. 

libavutil/imgutils.c:224:21: Taking true branch
  222.     ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };
  223. 
  224.     if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
                           ^
  225.         return 0;
  226. 

libavutil/imgutils.c:224:33: Taking true branch
  222.     ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };
  223. 
  224.     if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
                                       ^
  225.         return 0;
  226. 

libavutil/imgutils.c:225:9: 
  223. 
  224.     if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
  225.         return 0;
               ^
  226. 
  227.     av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h);

libavutil/imgutils.c:229:1: return from a call to av_image_check_size
  227.     av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h);
  228.     return AVERROR(EINVAL);
  229. }
       ^
  230. 
  231. void av_image_copy_plane(uint8_t       *dst, int dst_linesize,

libavcodec/imgconvert.c:470:8: Taking false branch
468.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
469. 
470.     if(av_image_check_size(width, height, 0, NULL))
            ^
471.         return -1;
472.     if (desc->flags & PIX_FMT_PSEUDOPAL)

libavcodec/imgconvert.c:472:9: 
470.     if(av_image_check_size(width, height, 0, NULL))
471.         return -1;
472.     if (desc->flags & PIX_FMT_PSEUDOPAL)
             ^
473.         // do not include palette for these pseudo-paletted formats
474.         return width * height;

int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
{
    AVPicture dummy_pict;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
    if(av_image_check_size(width, height, 0, NULL))
        return -1;
    if (desc->flags & PIX_FMT_PSEUDOPAL)
        return width * height;
    return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
}
['int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)\n{\n    AVPicture dummy_pict;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);\n    if(av_image_check_size(width, height, 0, NULL))\n        return -1;\n    if (desc->flags & PIX_FMT_PSEUDOPAL)\n        return width * height;\n    return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);\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}', 'int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)\n{\n    ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx };\n    if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)\n        return 0;\n    av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\\n", w, h);\n    return AVERROR(EINVAL);\n}']