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

libavcodec/flacdec.c:183:1: start of procedure ff_flac_parse_streaminfo()
181. }
182. 
183. void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
     ^
184.                               const uint8_t *buffer)
185. {

libavcodec/flacdec.c:187:5: 
185. {
186.     GetBitContext gb;
187.     init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
         ^
188. 
189.     /* mandatory streaminfo */

libavcodec/bitstream.h:737:1: start of procedure init_get_bits()
  735.  * @param bit_size the size of the buffer in bits
  736.  */
  737. static inline void init_get_bits(GetBitContext *s,
       ^
  738.                    const uint8_t *buffer, int bit_size)
  739. {

libavcodec/bitstream.h:740:5: 
  738.                    const uint8_t *buffer, int bit_size)
  739. {
  740.     int buffer_size= (bit_size+7)>>3;
           ^
  741.     if(buffer_size < 0 || bit_size < 0) {
  742.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:741:8: Taking true branch
  739. {
  740.     int buffer_size= (bit_size+7)>>3;
  741.     if(buffer_size < 0 || bit_size < 0) {
              ^
  742.         buffer_size = bit_size = 0;
  743.         buffer = NULL;

libavcodec/bitstream.h:742:9: 
  740.     int buffer_size= (bit_size+7)>>3;
  741.     if(buffer_size < 0 || bit_size < 0) {
  742.         buffer_size = bit_size = 0;
               ^
  743.         buffer = NULL;
  744.     }

libavcodec/bitstream.h:743:9: 
  741.     if(buffer_size < 0 || bit_size < 0) {
  742.         buffer_size = bit_size = 0;
  743.         buffer = NULL;
               ^
  744.     }
  745. 

libavcodec/bitstream.h:746:5: 
  744.     }
  745. 
  746.     s->buffer= buffer;
           ^
  747.     s->size_in_bits= bit_size;
  748.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:747:5: 
  745. 
  746.     s->buffer= buffer;
  747.     s->size_in_bits= bit_size;
           ^
  748.     s->buffer_end= buffer + buffer_size;
  749. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:748:5: 
  746.     s->buffer= buffer;
  747.     s->size_in_bits= bit_size;
  748.     s->buffer_end= buffer + buffer_size;
           ^
  749. #ifdef ALT_BITSTREAM_READER
  750.     s->index=0;

libavcodec/bitstream.h:750:5: 
  748.     s->buffer_end= buffer + buffer_size;
  749. #ifdef ALT_BITSTREAM_READER
  750.     s->index=0;
           ^
  751. #elif defined LIBMPEG2_BITSTREAM_READER
  752.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:760:1: return from a call to init_get_bits
  758.     skip_bits_long(s, 0);
  759. #endif
  760. }
       ^
  761. 
  762. static inline void align_get_bits(GetBitContext *s)

libavcodec/flacdec.c:190:5: 
188. 
189.     /* mandatory streaminfo */
190.     s->min_blocksize = get_bits(&gb, 16);
         ^
191.     s->max_blocksize = get_bits(&gb, 16);
192. 

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

libavcodec/bitstream.h:636:5: 
  634. static inline unsigned int get_bits(GetBitContext *s, int n){
  635.     register int tmp;
  636.     OPEN_READER(re, s)
           ^
  637.     UPDATE_CACHE(re, s)
  638.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:637:5: 
  635.     register int tmp;
  636.     OPEN_READER(re, s)
  637.     UPDATE_CACHE(re, s)
           ^
  638.     tmp= SHOW_UBITS(re, s, n);
  639.     LAST_SKIP_BITS(re, s, n)

void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
                              const uint8_t *buffer)
{
    GetBitContext gb;
    init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
    s->min_blocksize = get_bits(&gb, 16);
    s->max_blocksize = get_bits(&gb, 16);
    skip_bits(&gb, 24);
    s->max_framesize = get_bits_long(&gb, 24);
    s->samplerate = get_bits_long(&gb, 20);
    s->channels = get_bits(&gb, 3) + 1;
    s->bps = get_bits(&gb, 5) + 1;
    avctx->channels = s->channels;
    avctx->sample_rate = s->samplerate;
    avctx->bits_per_raw_sample = s->bps;
    if (s->bps > 16)
        avctx->sample_fmt = SAMPLE_FMT_S32;
    else
        avctx->sample_fmt = SAMPLE_FMT_S16;
    s->samples  = get_bits_long(&gb, 32) << 4;
    s->samples |= get_bits_long(&gb, 4);
    skip_bits(&gb, 64);
    skip_bits(&gb, 64);
    dump_headers(avctx, s);
}
['void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,\n                              const uint8_t *buffer)\n{\n    GetBitContext gb;\n    init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);\n    s->min_blocksize = get_bits(&gb, 16);\n    s->max_blocksize = get_bits(&gb, 16);\n    skip_bits(&gb, 24);\n    s->max_framesize = get_bits_long(&gb, 24);\n    s->samplerate = get_bits_long(&gb, 20);\n    s->channels = get_bits(&gb, 3) + 1;\n    s->bps = get_bits(&gb, 5) + 1;\n    avctx->channels = s->channels;\n    avctx->sample_rate = s->samplerate;\n    avctx->bits_per_raw_sample = s->bps;\n    if (s->bps > 16)\n        avctx->sample_fmt = SAMPLE_FMT_S32;\n    else\n        avctx->sample_fmt = SAMPLE_FMT_S16;\n    s->samples  = get_bits_long(&gb, 32) << 4;\n    s->samples |= get_bits_long(&gb, 4);\n    skip_bits(&gb, 64);\n    skip_bits(&gb, 64);\n    dump_headers(avctx, s);\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 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}']