libavcodec/xwdenc.c:44: error: Null Dereference
  pointer `desc` last assigned on line 37 could be null and is dereferenced by call to `av_get_bits_per_pixel()` at line 44, column 16.

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:1682:1: start of procedure av_pix_fmt_desc_get()
  1680. }
  1681. 
  1682. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1683. {
  1684.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

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

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

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

libavutil/pixdesc.c:1687:1: return from a call to av_pix_fmt_desc_get
  1685.         return NULL;
  1686.     return &av_pix_fmt_descriptors[pix_fmt];
  1687. }
        ^
  1688. 
  1689. 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: 
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;

libavutil/pixdesc.c:1654:1: start of procedure av_get_bits_per_pixel()
  1652. }
  1653. 
  1654. int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
        ^
  1655. {
  1656.     int c, bits = 0;

libavutil/pixdesc.c:1656:5: 
  1654. int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
  1655. {
  1656.     int c, bits = 0;
            ^
  1657.     int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
  1658. 

libavutil/pixdesc.c:1657:5: 
  1655. {
  1656.     int c, bits = 0;
  1657.     int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
            ^
  1658. 
  1659.     for (c = 0; c < pixdesc->nb_components; c++) {
