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

libavcodec/g726.c:365:1: start of procedure g726_decode_frame()
363. #endif
364. 
365. static int g726_decode_frame(AVCodecContext *avctx,
     ^
366.                              void *data, int *data_size,
367.                              AVPacket *avpkt)

libavcodec/g726.c:369:5: 
367.                              AVPacket *avpkt)
368. {
369.     const uint8_t *buf = avpkt->data;
         ^
370.     int buf_size = avpkt->size;
371.     G726Context *c = avctx->priv_data;

libavcodec/g726.c:370:5: 
368. {
369.     const uint8_t *buf = avpkt->data;
370.     int buf_size = avpkt->size;
         ^
371.     G726Context *c = avctx->priv_data;
372.     short *samples = data;

libavcodec/g726.c:371:5: 
369.     const uint8_t *buf = avpkt->data;
370.     int buf_size = avpkt->size;
371.     G726Context *c = avctx->priv_data;
         ^
372.     short *samples = data;
373.     GetBitContext gb;

libavcodec/g726.c:372:5: 
370.     int buf_size = avpkt->size;
371.     G726Context *c = avctx->priv_data;
372.     short *samples = data;
         ^
373.     GetBitContext gb;
374. 

libavcodec/g726.c:375:5: 
373.     GetBitContext gb;
374. 
375.     init_get_bits(&gb, buf, buf_size * 8);
         ^
376. 
377.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)

libavcodec/get_bits.h:493:1: start of procedure init_get_bits()
  491.  * @param bit_size the size of the buffer in bits
  492.  */
  493. static inline void init_get_bits(GetBitContext *s,
       ^
  494.                    const uint8_t *buffer, int bit_size)
  495. {

libavcodec/get_bits.h:496:5: 
  494.                    const uint8_t *buffer, int bit_size)
  495. {
  496.     int buffer_size= (bit_size+7)>>3;
           ^
  497.     if(buffer_size < 0 || bit_size < 0) {
  498.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:497:8: Taking true branch
  495. {
  496.     int buffer_size= (bit_size+7)>>3;
  497.     if(buffer_size < 0 || bit_size < 0) {
              ^
  498.         buffer_size = bit_size = 0;
  499.         buffer = NULL;

libavcodec/get_bits.h:498:9: 
  496.     int buffer_size= (bit_size+7)>>3;
  497.     if(buffer_size < 0 || bit_size < 0) {
  498.         buffer_size = bit_size = 0;
               ^
  499.         buffer = NULL;
  500.     }

libavcodec/get_bits.h:499:9: 
  497.     if(buffer_size < 0 || bit_size < 0) {
  498.         buffer_size = bit_size = 0;
  499.         buffer = NULL;
               ^
  500.     }
  501. 

libavcodec/get_bits.h:502:5: 
  500.     }
  501. 
  502.     s->buffer= buffer;
           ^
  503.     s->size_in_bits= bit_size;
  504.     s->buffer_end= buffer + buffer_size;

libavcodec/get_bits.h:503:5: 
  501. 
  502.     s->buffer= buffer;
  503.     s->size_in_bits= bit_size;
           ^
  504.     s->buffer_end= buffer + buffer_size;
  505. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:504:5: 
  502.     s->buffer= buffer;
  503.     s->size_in_bits= bit_size;
  504.     s->buffer_end= buffer + buffer_size;
           ^
  505. #ifdef ALT_BITSTREAM_READER
  506.     s->index=0;

libavcodec/get_bits.h:506:5: 
  504.     s->buffer_end= buffer + buffer_size;
  505. #ifdef ALT_BITSTREAM_READER
  506.     s->index=0;
           ^
  507. #elif defined LIBMPEG2_BITSTREAM_READER
  508.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/get_bits.h:516:1: return from a call to init_get_bits
  514.     skip_bits_long(s, 0);
  515. #endif
  516. }
       ^
  517. 
  518. static inline void align_get_bits(GetBitContext *s)

libavcodec/g726.c:377:12: 
375.     init_get_bits(&gb, buf, buf_size * 8);
376. 
377.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)
                ^
378.         *samples++ = g726_decode(c, get_bits(&gb, c->code_size));
379. 

libavcodec/get_bits.h:207:1: start of procedure get_bits_count()
  205.         ((uint32_t)name##_cache)
  206. 
  207. static inline int get_bits_count(GetBitContext *s){
       ^
  208.     return s->index;
  209. }

libavcodec/get_bits.h:208:5: 
  206. 
  207. static inline int get_bits_count(GetBitContext *s){
  208.     return s->index;
           ^
  209. }
  210. 

libavcodec/get_bits.h:209:1: return from a call to get_bits_count
  207. static inline int get_bits_count(GetBitContext *s){
  208.     return s->index;
  209. }
       ^
  210. 
  211. static inline void skip_bits_long(GetBitContext *s, int n){

libavcodec/g726.c:377:12: Loop condition is true. Entering loop body
375.     init_get_bits(&gb, buf, buf_size * 8);
376. 
377.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)
                ^
378.         *samples++ = g726_decode(c, get_bits(&gb, c->code_size));
379. 

libavcodec/g726.c:378:9: 
376. 
377.     while (get_bits_count(&gb) + c->code_size <= buf_size*8)
378.         *samples++ = g726_decode(c, get_bits(&gb, c->code_size));
             ^
379. 
380.     if(buf_size*8 != get_bits_count(&gb))

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

libavcodec/get_bits.h:387:5: 
  385. static inline unsigned int get_bits(GetBitContext *s, int n){
  386.     register int tmp;
  387.     OPEN_READER(re, s)
           ^
  388.     UPDATE_CACHE(re, s)
  389.     tmp= SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:388:5: 
  386.     register int tmp;
  387.     OPEN_READER(re, s)
  388.     UPDATE_CACHE(re, s)
           ^
  389.     tmp= SHOW_UBITS(re, s, n);
  390.     LAST_SKIP_BITS(re, s, n)

static int g726_decode_frame(AVCodecContext *avctx,
                             void *data, int *data_size,
                             AVPacket *avpkt)
{
    const uint8_t *buf = avpkt->data;
    int buf_size = avpkt->size;
    G726Context *c = avctx->priv_data;
    short *samples = data;
    GetBitContext gb;
    init_get_bits(&gb, buf, buf_size * 8);
    while (get_bits_count(&gb) + c->code_size <= buf_size*8)
        *samples++ = g726_decode(c, get_bits(&gb, c->code_size));
    if(buf_size*8 != get_bits_count(&gb))
        av_log(avctx, AV_LOG_ERROR, "Frame invalidly split, missing parser?\n");
    *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                             AVPacket *avpkt)\n{\n    const uint8_t *buf = avpkt->data;\n    int buf_size = avpkt->size;\n    G726Context *c = avctx->priv_data;\n    short *samples = data;\n    GetBitContext gb;\n    init_get_bits(&gb, buf, buf_size * 8);\n    while (get_bits_count(&gb) + c->code_size <= buf_size*8)\n        *samples++ = g726_decode(c, get_bits(&gb, c->code_size));\n    if(buf_size*8 != get_bits_count(&gb))\n        av_log(avctx, AV_LOG_ERROR, "Frame invalidly split, missing parser?\\n");\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}']