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

libavformat/mpegts.c:668:1: start of procedure read_sl_header()
666. }
667. 
668. static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
     ^
669. {
670.     GetBitContext gb;

libavformat/mpegts.c:671:5: 
669. {
670.     GetBitContext gb;
671.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
         ^
672.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
673.     int dts_flag = -1, cts_flag = -1;

libavformat/mpegts.c:672:5: 
670.     GetBitContext gb;
671.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
672.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
         ^
673.     int dts_flag = -1, cts_flag = -1;
674.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;

libavformat/mpegts.c:673:5: 
671.     int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
672.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
673.     int dts_flag = -1, cts_flag = -1;
         ^
674.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
675.     init_get_bits(&gb, buf, buf_size*8);

libavformat/mpegts.c:674:5: 
672.     int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
673.     int dts_flag = -1, cts_flag = -1;
674.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
         ^
675.     init_get_bits(&gb, buf, buf_size*8);
676. 

libavformat/mpegts.c:675:5: 
673.     int dts_flag = -1, cts_flag = -1;
674.     int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
675.     init_get_bits(&gb, buf, buf_size*8);
         ^
676. 
677.     if (sl->use_au_start)

libavcodec/get_bits.h:372:1: start of procedure init_get_bits()
  370.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  371.  */
  372. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  373.                                 int bit_size)
  374. {

libavcodec/get_bits.h:376:5: 
  374. {
  375.     int buffer_size;
  376.     int ret = 0;
           ^
  377. 
  378.     if (bit_size > INT_MAX - 7 || bit_size <= 0) {

libavcodec/get_bits.h:378:9: Taking true branch
  376.     int ret = 0;
  377. 
  378.     if (bit_size > INT_MAX - 7 || bit_size <= 0) {
               ^
  379.         buffer_size = bit_size = 0;
  380.         buffer = NULL;

libavcodec/get_bits.h:379:9: 
  377. 
  378.     if (bit_size > INT_MAX - 7 || bit_size <= 0) {
  379.         buffer_size = bit_size = 0;
               ^
  380.         buffer = NULL;
  381.         ret = AVERROR_INVALIDDATA;

libavcodec/get_bits.h:380:9: 
  378.     if (bit_size > INT_MAX - 7 || bit_size <= 0) {
  379.         buffer_size = bit_size = 0;
  380.         buffer = NULL;
               ^
  381.         ret = AVERROR_INVALIDDATA;
  382.     }

libavcodec/get_bits.h:381:9: 
  379.         buffer_size = bit_size = 0;
  380.         buffer = NULL;
  381.         ret = AVERROR_INVALIDDATA;
               ^
  382.     }
  383. 

libavcodec/get_bits.h:384:5: 
  382.     }
  383. 
  384.     buffer_size = (bit_size + 7) >> 3;
           ^
  385. 
  386.     s->buffer       = buffer;

libavcodec/get_bits.h:386:5: 
  384.     buffer_size = (bit_size + 7) >> 3;
  385. 
  386.     s->buffer       = buffer;
           ^
  387.     s->size_in_bits = bit_size;
  388. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:387:5: 
  385. 
  386.     s->buffer       = buffer;
  387.     s->size_in_bits = bit_size;
           ^
  388. #if !UNCHECKED_BITSTREAM_READER
  389.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:389:5: 
  387.     s->size_in_bits = bit_size;
  388. #if !UNCHECKED_BITSTREAM_READER
  389.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  390. #endif
  391.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:391:5: 
  389.     s->size_in_bits_plus8 = bit_size + 8;
  390. #endif
  391.     s->buffer_end   = buffer + buffer_size;
           ^
  392.     s->index        = 0;
  393.     return ret;

libavcodec/get_bits.h:392:5: 
  390. #endif
  391.     s->buffer_end   = buffer + buffer_size;
  392.     s->index        = 0;
           ^
  393.     return ret;
  394. }

libavcodec/get_bits.h:393:5: 
  391.     s->buffer_end   = buffer + buffer_size;
  392.     s->index        = 0;
  393.     return ret;
           ^
  394. }
  395. 

libavcodec/get_bits.h:394:1: return from a call to init_get_bits
  392.     s->index        = 0;
  393.     return ret;
  394. }
       ^
  395. 
  396. static inline void align_get_bits(GetBitContext *s)

libavformat/mpegts.c:677:9: Taking false branch
675.     init_get_bits(&gb, buf, buf_size*8);
676. 
677.     if (sl->use_au_start)
             ^
678.         au_start_flag = get_bits1(&gb);
679.     if (sl->use_au_end)

libavformat/mpegts.c:679:9: Taking true branch
677.     if (sl->use_au_start)
678.         au_start_flag = get_bits1(&gb);
679.     if (sl->use_au_end)
             ^
680.         au_end_flag = get_bits1(&gb);
681.     if (!sl->use_au_start && !sl->use_au_end)

libavformat/mpegts.c:680:9: 
678.         au_start_flag = get_bits1(&gb);
679.     if (sl->use_au_end)
680.         au_end_flag = get_bits1(&gb);
             ^
681.     if (!sl->use_au_start && !sl->use_au_end)
682.         au_start_flag = au_end_flag = 1;

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;
