libavcodec/g726.c:399: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 388 could be null and is dereferenced by call to `get_bits()` at line 399, column 21.

libavcodec/g726.c:374:1: start of procedure g726_decode_frame()
372. #endif
373. 
374. static int g726_decode_frame(AVCodecContext *avctx,
     ^
375.                              void *data, int *data_size,
376.                              const uint8_t *buf, int buf_size)

libavcodec/g726.c:378:5: 
376.                              const uint8_t *buf, int buf_size)
377. {
378.     AVG726Context *c = avctx->priv_data;
         ^
379.     short *samples = data;
380.     uint8_t code;

libavcodec/g726.c:379:5: 
377. {
378.     AVG726Context *c = avctx->priv_data;
379.     short *samples = data;
         ^
380.     uint8_t code;
381.     uint8_t mask;

libavcodec/g726.c:384:10: Taking false branch
382.     GetBitContext gb;
383. 
384.     if (!buf_size)
              ^
385.         goto out;
386. 

libavcodec/g726.c:387:5: 
385.         goto out;
386. 
387.     mask = (1<<c->code_size) - 1;
         ^
388.     init_get_bits(&gb, buf, buf_size * 8);
389.     if (c->bits_left) {

libavcodec/g726.c:388:5: 
386. 
387.     mask = (1<<c->code_size) - 1;
388.     init_get_bits(&gb, buf, buf_size * 8);
         ^
389.     if (c->bits_left) {
390.         int s = c->code_size - c->bits_left;

libavcodec/bitstream.h:758:1: start of procedure init_get_bits()
  756.  * @param bit_size the size of the buffer in bits
  757.  */
  758. static inline void init_get_bits(GetBitContext *s,
       ^
  759.                    const uint8_t *buffer, int bit_size)
  760. {

libavcodec/bitstream.h:761:5: 
  759.                    const uint8_t *buffer, int bit_size)
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
           ^
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:762:8: Taking true branch
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
              ^
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;

libavcodec/bitstream.h:763:9: 
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
               ^
  764.         buffer = NULL;
  765.     }

libavcodec/bitstream.h:764:9: 
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;
               ^
  765.     }
  766. 

libavcodec/bitstream.h:767:5: 
  765.     }
  766. 
  767.     s->buffer= buffer;
           ^
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:768:5: 
  766. 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
           ^
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:769:5: 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;
           ^
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;

libavcodec/bitstream.h:771:5: 
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;
           ^
  772. #elif defined LIBMPEG2_BITSTREAM_READER
  773.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:781:1: return from a call to init_get_bits
  779.     skip_bits_long(s, 0);
  780. #endif
  781. }
       ^
  782. 
  783. static inline void align_get_bits(GetBitContext *s)

libavcodec/g726.c:389:9: Taking false branch
387.     mask = (1<<c->code_size) - 1;
388.     init_get_bits(&gb, buf, buf_size * 8);
389.     if (c->bits_left) {
             ^
390.         int s = c->code_size - c->bits_left;
391.         code = (c->bit_buffer << s) | get_bits(&gb, s);

libavcodec/g726.c:395:12: 
393.     }
394. 
395.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)
                ^
396.         *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
397. 

libavcodec/bitstream.h:464:1: start of procedure get_bits_count()
  462.         ((uint32_t)name##_cache)
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
       ^
  465.     return s->index;
  466. }

libavcodec/bitstream.h:465:5: 
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
           ^
  466. }
  467. 

libavcodec/bitstream.h:466:1: return from a call to get_bits_count
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
  466. }
       ^
  467. 
  468. static inline void skip_bits_long(GetBitContext *s, int n){

libavcodec/g726.c:395:12: Loop condition is false. Leaving loop
393.     }
394. 
395.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)
                ^
396.         *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
397. 

libavcodec/g726.c:398:5: 
396.         *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
397. 
398.     c->bits_left = buf_size*8 - get_bits_count(&gb);
         ^
399.     c->bit_buffer = get_bits(&gb, c->bits_left);
400. 

libavcodec/bitstream.h:464:1: start of procedure get_bits_count()
  462.         ((uint32_t)name##_cache)
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
       ^
  465.     return s->index;
  466. }

libavcodec/bitstream.h:465:5: 
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
           ^
  466. }
  467. 

libavcodec/bitstream.h:466:1: return from a call to get_bits_count
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
  466. }
       ^
  467. 
  468. static inline void skip_bits_long(GetBitContext *s, int n){

libavcodec/g726.c:399:5: 
397. 
398.     c->bits_left = buf_size*8 - get_bits_count(&gb);
399.     c->bit_buffer = get_bits(&gb, c->bits_left);
         ^
400. 
401. out:

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

static int g726_decode_frame(AVCodecContext *avctx,
                             void *data, int *data_size,
                             const uint8_t *buf, int buf_size)
{
    AVG726Context *c = avctx->priv_data;
    short *samples = data;
    uint8_t code;
    uint8_t mask;
    GetBitContext gb;
    if (!buf_size)
        goto out;
    mask = (1<<c->code_size) - 1;
    init_get_bits(&gb, buf, buf_size * 8);
    if (c->bits_left) {
        int s = c->code_size - c->bits_left;
        code = (c->bit_buffer << s) | get_bits(&gb, s);
        *samples++ = g726_decode(&c->c, code & mask);
    }
    while (get_bits_count(&gb) + c->code_size <= buf_size*8)
        *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);
    c->bits_left = buf_size*8 - get_bits_count(&gb);
    c->bit_buffer = get_bits(&gb, c->bits_left);
out:
    *data_size = (uint8_t*)samples - (uint8_t*)data;
    return buf_size;
}
['static int g726_decode_frame(AVCodecContext *avctx,\n                             void *data, int *data_size,\n                             const uint8_t *buf, int buf_size)\n{\n    AVG726Context *c = avctx->priv_data;\n    short *samples = data;\n    uint8_t code;\n    uint8_t mask;\n    GetBitContext gb;\n    if (!buf_size)\n        goto out;\n    mask = (1<<c->code_size) - 1;\n    init_get_bits(&gb, buf, buf_size * 8);\n    if (c->bits_left) {\n        int s = c->code_size - c->bits_left;\n        code = (c->bit_buffer << s) | get_bits(&gb, s);\n        *samples++ = g726_decode(&c->c, code & mask);\n    }\n    while (get_bits_count(&gb) + c->code_size <= buf_size*8)\n        *samples++ = g726_decode(&c->c, get_bits(&gb, c->code_size) & mask);\n    c->bits_left = buf_size*8 - get_bits_count(&gb);\n    c->bit_buffer = get_bits(&gb, c->bits_left);\nout:\n    *data_size = (uint8_t*)samples - (uint8_t*)data;\n    return buf_size;\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size= (bit_size+7)>>3;\n    if(buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer= buffer;\n    s->size_in_bits= bit_size;\n    s->buffer_end= buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index=0;\n#elif defined LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 0);\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));\n    s->bit_count = 32 + 8*((intptr_t)buffer&3);\n    skip_bits_long(s, 0);\n#endif\n}', 'static inline int get_bits_count(GetBitContext *s){\n    return s->index;\n}', 'static inline unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    tmp= SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n    return tmp;\n}']