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

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

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

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

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

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

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

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

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

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

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

libavcodec/get_bits.h:362:1: start of procedure init_get_bits()
  360.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  361.  */
  362. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  363.                                 int bit_size)
  364. {

libavcodec/get_bits.h:366:5: 
  364. {
  365.     int buffer_size;
  366.     int ret = 0;
           ^
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {

libavcodec/get_bits.h:368:9: Taking true branch
  366.     int ret = 0;
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
               ^
  369.         bit_size    = 0;
  370.         buffer      = NULL;

libavcodec/get_bits.h:369:9: 
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  369.         bit_size    = 0;
               ^
  370.         buffer      = NULL;
  371.         ret         = AVERROR_INVALIDDATA;

libavcodec/get_bits.h:370:9: 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  369.         bit_size    = 0;
  370.         buffer      = NULL;
               ^
  371.         ret         = AVERROR_INVALIDDATA;
  372.     }

libavcodec/get_bits.h:371:9: 
  369.         bit_size    = 0;
  370.         buffer      = NULL;
  371.         ret         = AVERROR_INVALIDDATA;
               ^
  372.     }
  373. 

libavcodec/get_bits.h:374:5: 
  372.     }
  373. 
  374.     buffer_size = (bit_size + 7) >> 3;
           ^
  375. 
  376.     s->buffer             = buffer;

libavcodec/get_bits.h:376:5: 
  374.     buffer_size = (bit_size + 7) >> 3;
  375. 
  376.     s->buffer             = buffer;
           ^
  377.     s->size_in_bits       = bit_size;
  378. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:377:5: 
  375. 
  376.     s->buffer             = buffer;
  377.     s->size_in_bits       = bit_size;
           ^
  378. #if !UNCHECKED_BITSTREAM_READER
  379.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:379:5: 
  377.     s->size_in_bits       = bit_size;
  378. #if !UNCHECKED_BITSTREAM_READER
  379.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  380. #endif
  381.     s->buffer_end         = buffer + buffer_size;

libavcodec/get_bits.h:381:5: 
  379.     s->size_in_bits_plus8 = bit_size + 8;
  380. #endif
  381.     s->buffer_end         = buffer + buffer_size;
           ^
  382.     s->index              = 0;
  383. 

libavcodec/get_bits.h:382:5: 
  380. #endif
  381.     s->buffer_end         = buffer + buffer_size;
  382.     s->index              = 0;
           ^
  383. 
  384.     return ret;

libavcodec/get_bits.h:384:5: 
  382.     s->index              = 0;
  383. 
  384.     return ret;
           ^
  385. }
  386. 

libavcodec/get_bits.h:385:1: return from a call to init_get_bits
  383. 
  384.     return ret;
  385. }
       ^
  386. 
  387. /**

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

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

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

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

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