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

libavcodec/xwdenc.c:33:1: start of procedure xwd_encode_frame()
31. #define WINDOW_NAME_SIZE    11
32. 
33. static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
    ^
34.                             const AVFrame *p, int *got_packet)
35. {

libavcodec/xwdenc.c:36:5: 
34.                             const AVFrame *p, int *got_packet)
35. {
36.     enum AVPixelFormat pix_fmt = avctx->pix_fmt;
        ^
37.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
38.     uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;

libavcodec/xwdenc.c:37:5: 
35. {
36.     enum AVPixelFormat pix_fmt = avctx->pix_fmt;
37.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
        ^
38.     uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
39.     uint32_t rgb[3] = { 0 }, bitorder = 0;

libavutil/pixdesc.c:1685:1: start of procedure av_pix_fmt_desc_get()
  1683. }
  1684. 
  1685. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1686. {
  1687.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1687:9: Taking false branch
  1685. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1686. {
  1687.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1688.         return NULL;
  1689.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1687:24: Taking true branch
  1685. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1686. {
  1687.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1688.         return NULL;
  1689.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1688:9: 
  1686. {
  1687.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1688.         return NULL;
                ^
  1689.     return &av_pix_fmt_descriptors[pix_fmt];
  1690. }

libavutil/pixdesc.c:1690:1: return from a call to av_pix_fmt_desc_get
  1688.         return NULL;
  1689.     return &av_pix_fmt_descriptors[pix_fmt];
  1690. }
        ^
  1691. 
  1692. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/xwdenc.c:38:5: 
36.     enum AVPixelFormat pix_fmt = avctx->pix_fmt;
37.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
38.     uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
        ^
39.     uint32_t rgb[3] = { 0 }, bitorder = 0;
40.     uint32_t header_size;

libavcodec/xwdenc.c:39:5: 
37.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
38.     uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
39.     uint32_t rgb[3] = { 0 }, bitorder = 0;
        ^
40.     uint32_t header_size;
41.     int i, out_size, ret;

libavcodec/xwdenc.c:44:5: Skipping av_get_bits_per_pixel(): empty list of specs
42.     uint8_t *ptr, *buf;
43. 
44.     pixdepth = av_get_bits_per_pixel(desc);
        ^
45.     if (desc->flags & AV_PIX_FMT_FLAG_BE)
46.         be = 1;

libavcodec/xwdenc.c:45:9: 
43. 
44.     pixdepth = av_get_bits_per_pixel(desc);
45.     if (desc->flags & AV_PIX_FMT_FLAG_BE)
            ^
46.         be = 1;
47.     switch (pix_fmt) {
