libavformat/mpegts.c:700: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 689 could be null and is dereferenced by call to `get_bits1()` at line 700, column 21.

libavformat/mpegts.c:682:1: start of procedure read_sl_header()
680. }
681. 
682. static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
     ^
683. {
684.     GetBitContext gb;

libavformat/mpegts.c:685:5: 
683. {
684.     GetBitContext gb;
685.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
         ^
686.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687.     int dts_flag = -1, cts_flag = -1;

libavformat/mpegts.c:686:5: 
684.     GetBitContext gb;
685.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
686.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
         ^
687.     int dts_flag = -1, cts_flag = -1;
688.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;

libavformat/mpegts.c:687:5: 
685.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
686.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687.     int dts_flag = -1, cts_flag = -1;
         ^
688.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
689.     init_get_bits(&gb, buf, buf_size*8);

libavformat/mpegts.c:688:5: 
686.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687.     int dts_flag = -1, cts_flag = -1;
688.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
         ^
689.     init_get_bits(&gb, buf, buf_size*8);
690. 

libavformat/mpegts.c:689:5: 
687.     int dts_flag = -1, cts_flag = -1;
688.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
689.     init_get_bits(&gb, buf, buf_size*8);
         ^
690. 
691.     if (sl->use_au_start)

libavcodec/get_bits.h:352:1: start of procedure init_get_bits()
  350.  * @param bit_size the size of the buffer in bits
  351.  */
  352. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  353.                                  int bit_size)
  354. {

libavcodec/get_bits.h:355:5: 
  353.                                  int bit_size)
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
           ^
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:356:9: Taking true branch
  354. {
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
               ^
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;

libavcodec/get_bits.h:357:9: 
  355.     int buffer_size = (bit_size+7)>>3;
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;
               ^
  358.         buffer = NULL;
  359.     }

libavcodec/get_bits.h:358:9: 
  356.     if (buffer_size < 0 || bit_size < 0) {
  357.         buffer_size = bit_size = 0;
  358.         buffer = NULL;
               ^
  359.     }
  360. 

libavcodec/get_bits.h:361:5: 
  359.     }
  360. 
  361.     s->buffer       = buffer;
           ^
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:362:5: 
  360. 
  361.     s->buffer       = buffer;
  362.     s->size_in_bits = bit_size;
           ^
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:364:5: 
  362.     s->size_in_bits = bit_size;
  363. #if !UNCHECKED_BITSTREAM_READER
  364.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:366:5: 
  364.     s->size_in_bits_plus8 = bit_size + 8;
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
           ^
  367.     s->index        = 0;
  368. }

libavcodec/get_bits.h:367:5: 
  365. #endif
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
           ^
  368. }
  369. 

libavcodec/get_bits.h:368:1: return from a call to init_get_bits
  366.     s->buffer_end   = buffer + buffer_size;
  367.     s->index        = 0;
  368. }
       ^
  369. 
  370. static inline void align_get_bits(GetBitContext *s)

libavformat/mpegts.c:691:9: Taking false branch
689.     init_get_bits(&gb, buf, buf_size*8);
690. 
691.     if (sl->use_au_start)
             ^
692.         au_start_flag = get_bits1(&gb);
693.     if (sl->use_au_end)

libavformat/mpegts.c:693:9: Taking false branch
691.     if (sl->use_au_start)
692.         au_start_flag = get_bits1(&gb);
693.     if (sl->use_au_end)
             ^
694.         au_end_flag = get_bits1(&gb);
695.     if (!sl->use_au_start && !sl->use_au_end)

libavformat/mpegts.c:695:10: Taking true branch
693.     if (sl->use_au_end)
694.         au_end_flag = get_bits1(&gb);
695.     if (!sl->use_au_start && !sl->use_au_end)
              ^
696.         au_start_flag = au_end_flag = 1;
697.     if (sl->ocr_len > 0)

libavformat/mpegts.c:695:31: Taking true branch
693.     if (sl->use_au_end)
694.         au_end_flag = get_bits1(&gb);
695.     if (!sl->use_au_start && !sl->use_au_end)
                                   ^
696.         au_start_flag = au_end_flag = 1;
697.     if (sl->ocr_len > 0)

libavformat/mpegts.c:696:9: 
694.         au_end_flag = get_bits1(&gb);
695.     if (!sl->use_au_start && !sl->use_au_end)
696.         au_start_flag = au_end_flag = 1;
             ^
697.     if (sl->ocr_len > 0)
698.         ocr_flag = get_bits1(&gb);

libavformat/mpegts.c:697:9: Taking false branch
695.     if (!sl->use_au_start && !sl->use_au_end)
696.         au_start_flag = au_end_flag = 1;
697.     if (sl->ocr_len > 0)
             ^
698.         ocr_flag = get_bits1(&gb);
699.     if (sl->use_idle)

libavformat/mpegts.c:699:9: Taking true branch
697.     if (sl->ocr_len > 0)
698.         ocr_flag = get_bits1(&gb);
699.     if (sl->use_idle)
             ^
700.         idle_flag = get_bits1(&gb);
701.     if (sl->use_padding)

libavformat/mpegts.c:700:9: 
698.         ocr_flag = get_bits1(&gb);
699.     if (sl->use_idle)
700.         idle_flag = get_bits1(&gb);
             ^
701.     if (sl->use_padding)
702.         padding_flag = get_bits1(&gb);

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;
