libavcodec/mss2.c:481: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 479 could be null and is dereferenced by call to `get_bits1()` at line 481, column 20.

libavcodec/mss2.c:462:1: start of procedure mss2_decode_frame()
460. #define ARITH2_PADDING 2
461. 
462. static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     ^
463.                              AVPacket *avpkt)
464. {

libavcodec/mss2.c:465:5: 
463.                              AVPacket *avpkt)
464. {
465.     const uint8_t *buf = avpkt->data;
         ^
466.     int buf_size       = avpkt->size;
467.     MSS2Context *ctx = avctx->priv_data;

libavcodec/mss2.c:466:5: 
464. {
465.     const uint8_t *buf = avpkt->data;
466.     int buf_size       = avpkt->size;
         ^
467.     MSS2Context *ctx = avctx->priv_data;
468.     MSS12Context *c  = &ctx->c;

libavcodec/mss2.c:467:5: 
465.     const uint8_t *buf = avpkt->data;
466.     int buf_size       = avpkt->size;
467.     MSS2Context *ctx = avctx->priv_data;
         ^
468.     MSS12Context *c  = &ctx->c;
469.     AVFrame *frame   = data;

libavcodec/mss2.c:468:5: 
466.     int buf_size       = avpkt->size;
467.     MSS2Context *ctx = avctx->priv_data;
468.     MSS12Context *c  = &ctx->c;
         ^
469.     AVFrame *frame   = data;
470.     GetBitContext gb;

libavcodec/mss2.c:469:5: 
467.     MSS2Context *ctx = avctx->priv_data;
468.     MSS12Context *c  = &ctx->c;
469.     AVFrame *frame   = data;
         ^
470.     GetBitContext gb;
471.     GetByteContext gB;

libavcodec/mss2.c:477:5: 
475. 
476.     Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
477.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
         ^
478. 
479.     init_get_bits(&gb, buf, buf_size * 8);

libavcodec/mss2.c:479:5: 
477.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
478. 
479.     init_get_bits(&gb, buf, buf_size * 8);
         ^
480. 
481.     if (keyframe = get_bits1(&gb))

libavcodec/get_bits.h:362:1: start of procedure init_get_bits()
  360.  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  361.  */
  362. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  363.                                 int bit_size)
  364. {

libavcodec/get_bits.h:366:5: 
  364. {
  365.     int buffer_size;
  366.     int ret = 0;
           ^
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {

libavcodec/get_bits.h:368:9: Taking true branch
  366.     int ret = 0;
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
               ^
  369.         bit_size    = 0;
  370.         buffer      = NULL;

libavcodec/get_bits.h:369:9: 
  367. 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  369.         bit_size    = 0;
               ^
  370.         buffer      = NULL;
  371.         ret         = AVERROR_INVALIDDATA;

libavcodec/get_bits.h:370:9: 
  368.     if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) {
  369.         bit_size    = 0;
  370.         buffer      = NULL;
               ^
  371.         ret         = AVERROR_INVALIDDATA;
  372.     }

libavcodec/get_bits.h:371:9: 
  369.         bit_size    = 0;
  370.         buffer      = NULL;
  371.         ret         = AVERROR_INVALIDDATA;
               ^
  372.     }
  373. 

libavcodec/get_bits.h:374:5: 
  372.     }
  373. 
  374.     buffer_size = (bit_size + 7) >> 3;
           ^
  375. 
  376.     s->buffer             = buffer;

libavcodec/get_bits.h:376:5: 
  374.     buffer_size = (bit_size + 7) >> 3;
  375. 
  376.     s->buffer             = buffer;
           ^
  377.     s->size_in_bits       = bit_size;
  378. #if !UNCHECKED_BITSTREAM_READER

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

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

libavcodec/get_bits.h:381:5: 
  379.     s->size_in_bits_plus8 = bit_size + 8;
  380. #endif
  381.     s->buffer_end         = buffer + buffer_size;
           ^
  382.     s->index              = 0;
  383. 

libavcodec/get_bits.h:382:5: 
  380. #endif
  381.     s->buffer_end         = buffer + buffer_size;
  382.     s->index              = 0;
           ^
  383. 
  384.     return ret;

libavcodec/get_bits.h:384:5: 
  382.     s->index              = 0;
  383. 
  384.     return ret;
           ^
  385. }
  386. 

libavcodec/get_bits.h:385:1: return from a call to init_get_bits
  383. 
  384.     return ret;
  385. }
       ^
  386. 
  387. /**

libavcodec/mss2.c:481:9: 
479.     init_get_bits(&gb, buf, buf_size * 8);
480. 
481.     if (keyframe = get_bits1(&gb))
             ^
482.         skip_bits(&gb, 7);
483.     has_wmv9 = get_bits1(&gb);

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

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

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