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

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

libavcodec/flacdec.c:186:5: 
184. {
185.     GetBitContext gb;
186.     init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
         ^
187. 
188.     skip_bits(&gb, 16); /* skip min blocksize */

libavcodec/bitstream.h:743:1: start of procedure init_get_bits()
  741.  * @param bit_size the size of the buffer in bits
  742.  */
  743. static inline void init_get_bits(GetBitContext *s,
       ^
  744.                    const uint8_t *buffer, int bit_size)
  745. {

libavcodec/bitstream.h:746:5: 
  744.                    const uint8_t *buffer, int bit_size)
  745. {
  746.     int buffer_size= (bit_size+7)>>3;
           ^
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:747:8: Taking true branch
  745. {
  746.     int buffer_size= (bit_size+7)>>3;
  747.     if(buffer_size < 0 || bit_size < 0) {
              ^
  748.         buffer_size = bit_size = 0;
  749.         buffer = NULL;

libavcodec/bitstream.h:748:9: 
  746.     int buffer_size= (bit_size+7)>>3;
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;
               ^
  749.         buffer = NULL;
  750.     }

libavcodec/bitstream.h:749:9: 
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;
  749.         buffer = NULL;
               ^
  750.     }
  751. 

libavcodec/bitstream.h:752:5: 
  750.     }
  751. 
  752.     s->buffer= buffer;
           ^
  753.     s->size_in_bits= bit_size;
  754.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:753:5: 
  751. 
  752.     s->buffer= buffer;
  753.     s->size_in_bits= bit_size;
           ^
  754.     s->buffer_end= buffer + buffer_size;
  755. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:754:5: 
  752.     s->buffer= buffer;
  753.     s->size_in_bits= bit_size;
  754.     s->buffer_end= buffer + buffer_size;
           ^
  755. #ifdef ALT_BITSTREAM_READER
  756.     s->index=0;

libavcodec/bitstream.h:756:5: 
  754.     s->buffer_end= buffer + buffer_size;
  755. #ifdef ALT_BITSTREAM_READER
  756.     s->index=0;
           ^
  757. #elif defined LIBMPEG2_BITSTREAM_READER
  758.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:766:1: return from a call to init_get_bits
  764.     skip_bits_long(s, 0);
  765. #endif
  766. }
       ^
  767. 
  768. static inline void align_get_bits(GetBitContext *s)

libavcodec/flacdec.c:188:5: 
186.     init_get_bits(&gb, buffer, FLAC_STREAMINFO_SIZE*8);
187. 
188.     skip_bits(&gb, 16); /* skip min blocksize */
         ^
189.     s->max_blocksize = get_bits(&gb, 16);
190.     if (s->max_blocksize < 16) {

libavcodec/bitstream.h:658:1: start of procedure skip_bits()
  656. }
  657. 
  658. static inline void skip_bits(GetBitContext *s, int n){
       ^
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658. static inline void skip_bits(GetBitContext *s, int n){
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)
           ^
  661.     UPDATE_CACHE(re, s)
  662.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:661:5: 
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)
  661.     UPDATE_CACHE(re, s)
           ^
  662.     LAST_SKIP_BITS(re, s, n)
  663.     CLOSE_READER(re, s)

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);
    skip_bits(&gb, 16);
    s->max_blocksize = get_bits(&gb, 16);
    if (s->max_blocksize < 16) {
        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n",
               s->max_blocksize);
        s->max_blocksize = 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(&gb, 4);
    skip_bits_long(&gb, 64);
    skip_bits_long(&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    skip_bits(&gb, 16);\n    s->max_blocksize = get_bits(&gb, 16);\n    if (s->max_blocksize < 16) {\n        av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\\n",\n               s->max_blocksize);\n        s->max_blocksize = 16;\n    }\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(&gb, 4);\n    skip_bits_long(&gb, 64);\n    skip_bits_long(&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 void skip_bits(GetBitContext *s, int n){\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n}']