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

libavcodec/xwdenc.c:42:1: start of procedure xwd_encode_frame()
40. }
41. 
42. static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
    ^
43.                             const AVFrame *p, int *got_packet)
44. {

libavcodec/xwdenc.c:45:5: 
43.                             const AVFrame *p, int *got_packet)
44. {
45.     enum AVPixelFormat pix_fmt = avctx->pix_fmt;
        ^
46.     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
47.     uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;

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

libavutil/pixdesc.c:1199:1: start of procedure av_pix_fmt_desc_get()
  1197. }
  1198. 
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1201:9: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1201:24: Taking true branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1202:9: 
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1202.         return NULL;
                ^
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }

libavutil/pixdesc.c:1204:1: return from a call to av_pix_fmt_desc_get
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }
        ^
  1205. 
  1206. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

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

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

libavcodec/xwdenc.c:53:5: 
51.     uint8_t *ptr, *buf;
52. 
53.     pixdepth = av_get_bits_per_pixel(desc);
        ^
54.     if (desc->flags & PIX_FMT_BE)
55.         be = 1;

libavutil/pixdesc.c:1172:1: start of procedure av_get_bits_per_pixel()
  1170. }
  1171. 
  1172. int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
        ^
  1173. {
  1174.     int c, bits = 0;

libavutil/pixdesc.c:1174:5: 
  1172. int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
  1173. {
  1174.     int c, bits = 0;
            ^
  1175.     int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
  1176. 

libavutil/pixdesc.c:1175:5: 
  1173. {
  1174.     int c, bits = 0;
  1175.     int log2_pixels = pixdesc->log2_chroma_w + pixdesc->log2_chroma_h;
            ^
  1176. 
  1177.     for (c = 0; c < pixdesc->nb_components; c++) {
