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

libavcodec/xan.c:97:1: start of procedure xan_huffman_decode()
95. }
96. 
97. static int xan_huffman_decode(unsigned char *dest, int dest_len,
    ^
98.                               const unsigned char *src, int src_len)
99. {

libavcodec/xan.c:100:5: 
 98.                               const unsigned char *src, int src_len)
 99. {
100.     unsigned char byte = *src++;
         ^
101.     unsigned char ival = byte + 0x16;
102.     const unsigned char * ptr = src + byte*2;

libavcodec/xan.c:101:5: 
 99. {
100.     unsigned char byte = *src++;
101.     unsigned char ival = byte + 0x16;
         ^
102.     const unsigned char * ptr = src + byte*2;
103.     int ptr_len = src_len - 1 - byte*2;

libavcodec/xan.c:102:5: 
100.     unsigned char byte = *src++;
101.     unsigned char ival = byte + 0x16;
102.     const unsigned char * ptr = src + byte*2;
         ^
103.     int ptr_len = src_len - 1 - byte*2;
104.     unsigned char val = ival;

libavcodec/xan.c:103:5: 
101.     unsigned char ival = byte + 0x16;
102.     const unsigned char * ptr = src + byte*2;
103.     int ptr_len = src_len - 1 - byte*2;
         ^
104.     unsigned char val = ival;
105.     unsigned char *dest_end = dest + dest_len;

libavcodec/xan.c:104:5: 
102.     const unsigned char * ptr = src + byte*2;
103.     int ptr_len = src_len - 1 - byte*2;
104.     unsigned char val = ival;
         ^
105.     unsigned char *dest_end = dest + dest_len;
106.     GetBitContext gb;

libavcodec/xan.c:105:5: 
103.     int ptr_len = src_len - 1 - byte*2;
104.     unsigned char val = ival;
105.     unsigned char *dest_end = dest + dest_len;
         ^
106.     GetBitContext gb;
107. 

libavcodec/xan.c:108:9: Taking false branch
106.     GetBitContext gb;
107. 
108.     if (ptr_len < 0)
             ^
109.         return AVERROR_INVALIDDATA;
110. 

libavcodec/xan.c:111:5: 
109.         return AVERROR_INVALIDDATA;
110. 
111.     init_get_bits(&gb, ptr, ptr_len * 8);
         ^
112. 
113.     while (val != 0x16) {

libavcodec/get_bits.h:352:1: start of procedure init_get_bits()
  350.  * @param bit_size the size of the buffer in bits
  351.  */
  352. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  353.                                  int bit_size)
  354. {

libavcodec/get_bits.h:355:5: 
  353.                                  int bit_size)
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
           ^
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:356:9: Taking true branch
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
               ^
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;

libavcodec/get_bits.h:357:9: 
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;
               ^
  358.         buffer = NULL;
  359.     }

libavcodec/get_bits.h:358:9: 
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;
               ^
  359.     }
  360. 

libavcodec/get_bits.h:361:5: 
  359.     }
  360. 
  361.     s->buffer       = buffer;
           ^
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:362:5: 
  360. 
  361.     s->buffer       = buffer;
  362.     s->size_in_bits = bit_size;
           ^
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:364:5: 
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:366:5: 
  364.     s->size_in_bits_plus8 = bit_size + 8;
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
           ^
  367.     s->index        = 0;
  368. }

libavcodec/get_bits.h:367:5: 
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
           ^
  368. }
  369. 

libavcodec/get_bits.h:368:1: return from a call to init_get_bits
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
  368. }
       ^
  369. 
  370. static inline void align_get_bits(GetBitContext *s)

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

libavcodec/xan.c:114:9: 
112. 
113.     while (val != 0x16) {
114.         unsigned idx = val - 0x17 + get_bits1(&gb) * byte;
             ^
115.         if (idx >= 2 * byte)
116.             return -1;

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
  266. }
  267. 
  268. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  269. {
  270.     unsigned int index = s->index;

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

libavcodec/get_bits.h:271:5: 
  269. {
  270.     unsigned int index = s->index;
  271.     uint8_t result = s->buffer[index>>3];
           ^
  272. #ifdef BITSTREAM_READER_LE
  273.     result >>= index & 7;
