libavcodec/xan.c:134: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 131 could be null and is dereferenced by call to `get_bits1()` at line 134, column 37.

libavcodec/xan.c:116:1: start of procedure xan_huffman_decode()
114. }
115. 
116. static int xan_huffman_decode(unsigned char *dest, int dest_len,
     ^
117.                               const unsigned char *src, int src_len)
118. {

libavcodec/xan.c:119:5: 
117.                               const unsigned char *src, int src_len)
118. {
119.     unsigned char byte = *src++;
         ^
120.     unsigned char ival = byte + 0x16;
121.     const unsigned char * ptr = src + byte*2;

libavcodec/xan.c:120:5: 
118. {
119.     unsigned char byte = *src++;
120.     unsigned char ival = byte + 0x16;
         ^
121.     const unsigned char * ptr = src + byte*2;
122.     int ptr_len = src_len - 1 - byte*2;

libavcodec/xan.c:121:5: 
119.     unsigned char byte = *src++;
120.     unsigned char ival = byte + 0x16;
121.     const unsigned char * ptr = src + byte*2;
         ^
122.     int ptr_len = src_len - 1 - byte*2;
123.     unsigned char val = ival;

libavcodec/xan.c:122:5: 
120.     unsigned char ival = byte + 0x16;
121.     const unsigned char * ptr = src + byte*2;
122.     int ptr_len = src_len - 1 - byte*2;
         ^
123.     unsigned char val = ival;
124.     unsigned char *dest_end = dest + dest_len;

libavcodec/xan.c:123:5: 
121.     const unsigned char * ptr = src + byte*2;
122.     int ptr_len = src_len - 1 - byte*2;
123.     unsigned char val = ival;
         ^
124.     unsigned char *dest_end = dest + dest_len;
125.     unsigned char *dest_start = dest;

libavcodec/xan.c:124:5: 
122.     int ptr_len = src_len - 1 - byte*2;
123.     unsigned char val = ival;
124.     unsigned char *dest_end = dest + dest_len;
         ^
125.     unsigned char *dest_start = dest;
126.     GetBitContext gb;

libavcodec/xan.c:125:5: 
123.     unsigned char val = ival;
124.     unsigned char *dest_end = dest + dest_len;
125.     unsigned char *dest_start = dest;
         ^
126.     GetBitContext gb;
127. 

libavcodec/xan.c:128:9: Taking false branch
126.     GetBitContext gb;
127. 
128.     if (ptr_len < 0)
             ^
129.         return AVERROR_INVALIDDATA;
130. 

libavcodec/xan.c:131:5: 
129.         return AVERROR_INVALIDDATA;
130. 
131.     init_get_bits(&gb, ptr, ptr_len * 8);
         ^
132. 
133.     while (val != 0x16) {

libavcodec/get_bits.h:376:1: start of procedure init_get_bits()
  374.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  375.  */
  376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  377.                                 int bit_size)
  378. {

libavcodec/get_bits.h:380:5: 
  378. {
  379.     int buffer_size;
  380.     int ret = 0;
           ^
  381. 
  382.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {

libavcodec/get_bits.h:382:9: Taking true branch
  380.     int ret = 0;
  381. 
  382.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
               ^
  383.         bit_size    = 0;
  384.         buffer      = NULL;

libavcodec/get_bits.h:383:9: 
  381. 
  382.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  383.         bit_size    = 0;
               ^
  384.         buffer      = NULL;
  385.         ret         = AVERROR_INVALIDDATA;

libavcodec/get_bits.h:384:9: 
  382.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  383.         bit_size    = 0;
  384.         buffer      = NULL;
               ^
  385.         ret         = AVERROR_INVALIDDATA;
  386.     }

libavcodec/get_bits.h:385:9: 
  383.         bit_size    = 0;
  384.         buffer      = NULL;
  385.         ret         = AVERROR_INVALIDDATA;
               ^
  386.     }
  387. 

libavcodec/get_bits.h:388:5: 
  386.     }
  387. 
  388.     buffer_size = (bit_size + 7) >> 3;
           ^
  389. 
  390.     s->buffer             = buffer;

libavcodec/get_bits.h:390:5: 
  388.     buffer_size = (bit_size + 7) >> 3;
  389. 
  390.     s->buffer             = buffer;
           ^
  391.     s->size_in_bits       = bit_size;
  392. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:391:5: 
  389. 
  390.     s->buffer             = buffer;
  391.     s->size_in_bits       = bit_size;
           ^
  392. #if !UNCHECKED_BITSTREAM_READER
  393.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:393:5: 
  391.     s->size_in_bits       = bit_size;
  392. #if !UNCHECKED_BITSTREAM_READER
  393.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  394. #endif
  395.     s->buffer_end         = buffer + buffer_size;

libavcodec/get_bits.h:395:5: 
  393.     s->size_in_bits_plus8 = bit_size + 8;
  394. #endif
  395.     s->buffer_end         = buffer + buffer_size;
           ^
  396.     s->index              = 0;
  397. 

libavcodec/get_bits.h:396:5: 
  394. #endif
  395.     s->buffer_end         = buffer + buffer_size;
  396.     s->index              = 0;
           ^
  397. 
  398.     return ret;

libavcodec/get_bits.h:398:5: 
  396.     s->index              = 0;
  397. 
  398.     return ret;
           ^
  399. }
  400. 

libavcodec/get_bits.h:399:1: return from a call to init_get_bits
  397. 
  398.     return ret;
  399. }
       ^
  400. 
  401. /**

libavcodec/xan.c:133:12: Loop condition is true. Entering loop body
131.     init_get_bits(&gb, ptr, ptr_len * 8);
132. 
133.     while (val != 0x16) {
                ^
134.         unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
135.         if (idx >= 2 * byte)

libavcodec/xan.c:134:9: 
132. 
133.     while (val != 0x16) {
134.         unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
             ^
135.         if (idx >= 2 * byte)
136.             return AVERROR_INVALIDDATA;

libavcodec/get_bits.h:272:1: start of procedure get_bits1()
  270. }
  271. 
  272. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  273. {
  274.     unsigned int index = s->index;

libavcodec/get_bits.h:274:5: 
  272. static inline unsigned int get_bits1(GetBitContext *s)
  273. {
  274.     unsigned int index = s->index;
           ^
  275.     uint8_t result     = s->buffer[index >> 3];
  276. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:275:5: 
  273. {
  274.     unsigned int index = s->index;
  275.     uint8_t result     = s->buffer[index >> 3];
           ^
  276. #ifdef BITSTREAM_READER_LE
  277.     result >>= index & 7;
