libavcodec/flac_parser.c:96: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 95 could be null and is dereferenced by call to `ff_flac_decode_frame_header()` at line 96, column 13.

libavcodec/flac_parser.c:91:1: start of procedure frame_header_is_valid()
89. } FLACParseContext;
90. 
91. static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf,
    ^
92.                                  FLACFrameInfo *fi)
93. {

libavcodec/flac_parser.c:95:5: 
93. {
94.     GetBitContext gb;
95.     init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8);
        ^
96.     return !ff_flac_decode_frame_header(avctx, &gb, fi, 127);
97. }

libavcodec/get_bits.h:370:1: start of procedure init_get_bits()
  368.  * @param bit_size the size of the buffer in bits
  369.  */
  370. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  371.                                  int bit_size)
  372. {

libavcodec/get_bits.h:373:5: 
  371.                                  int bit_size)
  372. {
  373.     int buffer_size = (bit_size+7)>>3;
           ^
  374.     if (buffer_size < 0 || bit_size < 0) {
  375.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:374:9: Taking true branch
  372. {
  373.     int buffer_size = (bit_size+7)>>3;
  374.     if (buffer_size < 0 || bit_size < 0) {
               ^
  375.         buffer_size = bit_size = 0;
  376.         buffer = NULL;

libavcodec/get_bits.h:375:9: 
  373.     int buffer_size = (bit_size+7)>>3;
  374.     if (buffer_size < 0 || bit_size < 0) {
  375.         buffer_size = bit_size = 0;
               ^
  376.         buffer = NULL;
  377.     }

libavcodec/get_bits.h:376:9: 
  374.     if (buffer_size < 0 || bit_size < 0) {
  375.         buffer_size = bit_size = 0;
  376.         buffer = NULL;
               ^
  377.     }
  378. 

libavcodec/get_bits.h:379:5: 
  377.     }
  378. 
  379.     s->buffer       = buffer;
           ^
  380.     s->size_in_bits = bit_size;
  381. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:380:5: 
  378. 
  379.     s->buffer       = buffer;
  380.     s->size_in_bits = bit_size;
           ^
  381. #if !UNCHECKED_BITSTREAM_READER
  382.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:382:5: 
  380.     s->size_in_bits = bit_size;
  381. #if !UNCHECKED_BITSTREAM_READER
  382.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  383. #endif
  384.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:384:5: 
  382.     s->size_in_bits_plus8 = bit_size + 8;
  383. #endif
  384.     s->buffer_end   = buffer + buffer_size;
           ^
  385.     s->index        = 0;
  386. }

libavcodec/get_bits.h:385:5: 
  383. #endif
  384.     s->buffer_end   = buffer + buffer_size;
  385.     s->index        = 0;
           ^
  386. }
  387. 

libavcodec/get_bits.h:386:1: return from a call to init_get_bits
  384.     s->buffer_end   = buffer + buffer_size;
  385.     s->index        = 0;
  386. }
       ^
  387. 
  388. static inline void align_get_bits(GetBitContext *s)

libavcodec/flac_parser.c:96:13: 
94.     GetBitContext gb;
95.     init_get_bits(&gb, buf, MAX_FRAME_HEADER_SIZE * 8);
96.     return !ff_flac_decode_frame_header(avctx, &gb, fi, 127);
                ^
97. }
98. 

libavcodec/flac.c:48:1: start of procedure ff_flac_decode_frame_header()
  46. }
  47. 
  48. int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb,
      ^
  49.                                 FLACFrameInfo *fi, int log_level_offset)
  50. {

libavcodec/flac.c:54:9: Taking false branch
  52. 
  53.     /* frame sync code */
  54.     if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) {
              ^
  55.         av_log(avctx, AV_LOG_ERROR + log_level_offset, "invalid sync code\n");
  56.         return -1;

libavcodec/flac.c:60:5: 
  58. 
  59.     /* variable block size stream code */
  60.     fi->is_var_size = get_bits1(gb);
          ^
  61. 
  62.     /* block size and sample rate codes */

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
    266. }
    267. 
    268. static inline unsigned int get_bits1(GetBitContext *s)
         ^
    269. {
    270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
    268. static inline unsigned int get_bits1(GetBitContext *s)
    269. {
    270.     unsigned int index = s->index;
             ^
    271.     uint8_t result = s->buffer[index>>3];
    272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
    269. {
    270.     unsigned int index = s->index;
    271.     uint8_t result = s->buffer[index>>3];
             ^
    272. #ifdef BITSTREAM_READER_LE
    273.     result >>= index & 7;

libavcodec/get_bits.h:273:5: 
    271.     uint8_t result = s->buffer[index>>3];
    272. #ifdef BITSTREAM_READER_LE
    273.     result >>= index & 7;
             ^
    274.     result &= 1;
    275. #else

libavcodec/get_bits.h:274:5: 
    272. #ifdef BITSTREAM_READER_LE
    273.     result >>= index & 7;
    274.     result &= 1;
             ^
    275. #else
    276.     result <<= index & 7;

libavcodec/get_bits.h:280:9: Taking false branch
    278. #endif
    279. #if !UNCHECKED_BITSTREAM_READER
    280.     if (s->index < s->size_in_bits_plus8)
                 ^
    281. #endif
    282.         index++;

libavcodec/get_bits.h:283:5: 
    281. #endif
    282.         index++;
    283.     s->index = index;
             ^
    284. 
    285.     return result;

libavcodec/get_bits.h:285:5: 
    283.     s->index = index;
    284. 
    285.     return result;
             ^
    286. }
    287. 

libavcodec/get_bits.h:286:1: return from a call to get_bits1
    284. 
    285.     return result;
    286. }
         ^
    287. 
    288. static inline unsigned int show_bits1(GetBitContext *s)

libavcodec/flac.c:63:5: Skipping get_bits(): empty list of specs
  61. 
  62.     /* block size and sample rate codes */
  63.     bs_code = get_bits(gb, 4);
          ^
  64.     sr_code = get_bits(gb, 4);
  65. 

libavcodec/flac.c:64:5: Skipping get_bits(): empty list of specs
  62.     /* block size and sample rate codes */
  63.     bs_code = get_bits(gb, 4);
  64.     sr_code = get_bits(gb, 4);
          ^
  65. 
  66.     /* channels and decorrelation */

libavcodec/flac.c:67:5: Skipping get_bits(): empty list of specs
  65. 
  66.     /* channels and decorrelation */
  67.     fi->ch_mode = get_bits(gb, 4);
          ^
  68.     if (fi->ch_mode < FLAC_MAX_CHANNELS) {
  69.         fi->channels = fi->ch_mode + 1;

libavcodec/flac.c:68:9: Taking false branch
  66.     /* channels and decorrelation */
  67.     fi->ch_mode = get_bits(gb, 4);
  68.     if (fi->ch_mode < FLAC_MAX_CHANNELS) {
              ^
  69.         fi->channels = fi->ch_mode + 1;
  70.         fi->ch_mode = FLAC_CHMODE_INDEPENDENT;

libavcodec/flac.c:71:16: Taking true branch
  69.         fi->channels = fi->ch_mode + 1;
  70.         fi->ch_mode = FLAC_CHMODE_INDEPENDENT;
  71.     } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) {
                     ^
  72.         fi->channels = 2;
  73.         fi->ch_mode -= FLAC_MAX_CHANNELS - 1;

libavcodec/flac.c:72:9: 
  70.         fi->ch_mode = FLAC_CHMODE_INDEPENDENT;
  71.     } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) {
  72.         fi->channels = 2;
              ^
  73.         fi->ch_mode -= FLAC_MAX_CHANNELS - 1;
  74.     } else {

libavcodec/flac.c:73:9: 
  71.     } else if (fi->ch_mode < FLAC_MAX_CHANNELS + FLAC_CHMODE_MID_SIDE) {
  72.         fi->channels = 2;
  73.         fi->ch_mode -= FLAC_MAX_CHANNELS - 1;
              ^
  74.     } else {
  75.         av_log(avctx, AV_LOG_ERROR + log_level_offset,

libavcodec/flac.c:81:5: Skipping get_bits(): empty list of specs
  79. 
  80.     /* bits per sample */
  81.     bps_code = get_bits(gb, 3);
          ^
  82.     if (bps_code == 3 || bps_code == 7) {
  83.         av_log(avctx, AV_LOG_ERROR + log_level_offset,

libavcodec/flac.c:82:9: Taking false branch
  80.     /* bits per sample */
  81.     bps_code = get_bits(gb, 3);
  82.     if (bps_code == 3 || bps_code == 7) {
              ^
  83.         av_log(avctx, AV_LOG_ERROR + log_level_offset,
  84.                "invalid sample size code (%d)\n",

libavcodec/flac.c:82:26: Taking false branch
  80.     /* bits per sample */
  81.     bps_code = get_bits(gb, 3);
  82.     if (bps_code == 3 || bps_code == 7) {
                               ^
  83.         av_log(avctx, AV_LOG_ERROR + log_level_offset,
  84.                "invalid sample size code (%d)\n",

libavcodec/flac.c:88:5: 
  86.         return -1;
  87.     }
  88.     fi->bps = sample_size_table[bps_code];
          ^
  89. 
  90.     /* reserved bit */

libavcodec/flac.c:91:9: 
  89. 
  90.     /* reserved bit */
  91.     if (get_bits1(gb)) {
              ^
  92.         av_log(avctx, AV_LOG_ERROR + log_level_offset,
  93.                "broken stream, invalid padding\n");

libavcodec/get_bits.h:268:1: start of procedure get_bits1()
    266. }
    267. 
    268. static inline unsigned int get_bits1(GetBitContext *s)
         ^
    269. {
    270.     unsigned int index = s->index;

libavcodec/get_bits.h:270:5: 
    268. static inline unsigned int get_bits1(GetBitContext *s)
    269. {
    270.     unsigned int index = s->index;
             ^
    271.     uint8_t result = s->buffer[index>>3];
    272. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:271:5: 
    269. {
    270.     unsigned int index = s->index;
    271.     uint8_t result = s->buffer[index>>3];
             ^
    272. #ifdef BITSTREAM_READER_LE
    273.     result >>= index & 7;
