libavcodec/wmavoice.c:1682: error: Null Dereference
  pointer `gb->buffer` last assigned on line 1675 could be null and is dereferenced by call to `get_bits1()` at line 1682, column 10.

libavcodec/wmavoice.c:1667:1: start of procedure check_bits_for_superframe()
1665.  * @return < 0 on error, 1 on not enough bits or 0 if OK.
1666.  */
1667. static int check_bits_for_superframe(GetBitContext *orig_gb,
      ^
1668.                                      WMAVoiceContext *s)
1669. {

libavcodec/wmavoice.c:1670:5: 
1668.                                      WMAVoiceContext *s)
1669. {
1670.     GetBitContext s_gb, *gb = &s_gb;
          ^
1671.     int n, need_bits, bd_idx;
1672.     const struct frame_type_desc *frame_desc;

libavcodec/wmavoice.c:1675:5: 
1673. 
1674.     /* initialize a copy */
1675.     init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits);
          ^
1676.     skip_bits_long(gb, get_bits_count(orig_gb));
1677.     assert(get_bits_left(gb) == get_bits_left(orig_gb));

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/wmavoice.c:1676:5: 
1674.     /* initialize a copy */
1675.     init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits);
1676.     skip_bits_long(gb, get_bits_count(orig_gb));
          ^
1677.     assert(get_bits_left(gb) == get_bits_left(orig_gb));
1678. 

libavcodec/get_bits.h:195:1: start of procedure get_bits_count()
  193. #define GET_CACHE(name, gb) ((uint32_t) name ## _cache)
  194. 
  195. static inline int get_bits_count(const GetBitContext *s)
       ^
  196. {
  197.     return s->index;

libavcodec/get_bits.h:197:5: 
  195. static inline int get_bits_count(const GetBitContext *s)
  196. {
  197.     return s->index;
           ^
  198. }
  199. 

libavcodec/get_bits.h:198:1: return from a call to get_bits_count
  196. {
  197.     return s->index;
  198. }
       ^
  199. 
  200. static inline void skip_bits_long(GetBitContext *s, int n)

libavcodec/get_bits.h:200:1: start of procedure skip_bits_long()
  198. }
  199. 
  200. static inline void skip_bits_long(GetBitContext *s, int n)
       ^
  201. {
  202. #if UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:203:5: 
  201. {
  202. #if UNCHECKED_BITSTREAM_READER
  203.     s->index += n;
           ^
  204. #else
  205.     s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index);

libavcodec/get_bits.h:207:1: return from a call to skip_bits_long
  205.     s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index);
  206. #endif
  207. }
       ^
  208. 
  209. /**

libavcodec/wmavoice.c:1677:5: 
1675.     init_get_bits(gb, orig_gb->buffer, orig_gb->size_in_bits);
1676.     skip_bits_long(gb, get_bits_count(orig_gb));
1677.     assert(get_bits_left(gb) == get_bits_left(orig_gb));
          ^
1678. 
1679.     /* superframe header */

libavcodec/wmavoice.c:1680:9: 
1678. 
1679.     /* superframe header */
1680.     if (get_bits_left(gb) < 14)
              ^
1681.         return 1;
1682.     if (!get_bits1(gb))

libavcodec/get_bits.h:556:1: start of procedure get_bits_left()
  554. }
  555. 
  556. static inline int get_bits_left(GetBitContext *gb)
       ^
  557. {
  558.     return gb->size_in_bits - get_bits_count(gb);

libavcodec/get_bits.h:558:5: 
  556. static inline int get_bits_left(GetBitContext *gb)
  557. {
  558.     return gb->size_in_bits - get_bits_count(gb);
           ^
  559. }
  560. 

libavcodec/get_bits.h:195:1: start of procedure get_bits_count()
    193. #define GET_CACHE(name, gb) ((uint32_t) name ## _cache)
    194. 
    195. static inline int get_bits_count(const GetBitContext *s)
         ^
    196. {
    197.     return s->index;

libavcodec/get_bits.h:197:5: 
    195. static inline int get_bits_count(const GetBitContext *s)
    196. {
    197.     return s->index;
             ^
    198. }
    199. 

libavcodec/get_bits.h:198:1: return from a call to get_bits_count
    196. {
    197.     return s->index;
    198. }
         ^
    199. 
    200. static inline void skip_bits_long(GetBitContext *s, int n)

libavcodec/get_bits.h:559:1: return from a call to get_bits_left
  557. {
  558.     return gb->size_in_bits - get_bits_count(gb);
  559. }
       ^
  560. 
  561. //#define TRACE

libavcodec/wmavoice.c:1680:9: Taking false branch
1678. 
1679.     /* superframe header */
1680.     if (get_bits_left(gb) < 14)
              ^
1681.         return 1;
1682.     if (!get_bits1(gb))

libavcodec/wmavoice.c:1682:10: 
1680.     if (get_bits_left(gb) < 14)
1681.         return 1;
1682.     if (!get_bits1(gb))
               ^
1683.         return AVERROR(ENOSYS);           // WMAPro-in-WMAVoice superframe
1684.     if (get_bits1(gb)) skip_bits(gb, 12); // number of  samples in superframe

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;
