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

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

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

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

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

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

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

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

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

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

libavcodec/get_bits.h:306:1: start of procedure init_get_bits()
  304.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  305.  */
  306. static inline void init_get_bits(GetBitContext *s,
       ^
  307.                    const uint8_t *buffer, int bit_size)
  308. {

libavcodec/get_bits.h:309:5: 
  307.                    const uint8_t *buffer, int bit_size)
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
           ^
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:310:9: Taking true branch
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
               ^
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;

libavcodec/get_bits.h:311:9: 
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
               ^
  312.         buffer = NULL;
  313.     }

libavcodec/get_bits.h:312:9: 
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;
               ^
  313.     }
  314. 

libavcodec/get_bits.h:315:5: 
  313.     }
  314. 
  315.     s->buffer       = buffer;
           ^
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:316:5: 
  314. 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
           ^
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;

libavcodec/get_bits.h:317:5: 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
           ^
  318.     s->index        = 0;
  319. }

libavcodec/get_bits.h:318:5: 
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
           ^
  319. }
  320. 

libavcodec/get_bits.h:319:1: return from a call to init_get_bits
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
  319. }
       ^
  320. 
  321. static inline void align_get_bits(GetBitContext *s)

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

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

libavcodec/get_bits.h:230:1: start of procedure get_bits1()
  228. }
  229. 
  230. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  231.     unsigned int index = s->index;
  232.     uint8_t result = s->buffer[index>>3];

libavcodec/get_bits.h:231:5: 
  229. 
  230. static inline unsigned int get_bits1(GetBitContext *s){
  231.     unsigned int index = s->index;
           ^
  232.     uint8_t result = s->buffer[index>>3];
  233. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:232:5: 
  230. static inline unsigned int get_bits1(GetBitContext *s){
  231.     unsigned int index = s->index;
  232.     uint8_t result = s->buffer[index>>3];
           ^
  233. #ifdef ALT_BITSTREAM_READER_LE
  234.     result >>= index & 7;
