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

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

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

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

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

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

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

libavcodec/mss2.c:475:5: 
473. 
474.     Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
475.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
         ^
476. 
477.     av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=

libavcodec/mss2.c:477:5: Taking false branch
475.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
476. 
477.     av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
         ^
478.                ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
479. 

libavcodec/mss2.c:477:5: Loop condition is false. Leaving loop
475.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
476. 
477.     av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=
         ^
478.                ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
479. 

libavcodec/mss2.c:480:5: 
478.                ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
479. 
480.     init_get_bits(&gb, buf, buf_size * 8);
         ^
481. 
482.     if (keyframe = get_bits1(&gb))

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

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

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

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

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

libavcodec/get_bits.h:384:9: 
  382.         buffer_size = bit_size = 0;
  383.         buffer      = NULL;
  384.         ret         = AVERROR_INVALIDDATA;
               ^
  385.     }
  386. 

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

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

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

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

libavcodec/get_bits.h:394:5: 
  392.     s->size_in_bits_plus8 = bit_size + 8;
  393. #endif
  394.     s->buffer_end         = buffer + buffer_size;
           ^
  395.     s->index              = 0;
  396. 

libavcodec/get_bits.h:395:5: 
  393. #endif
  394.     s->buffer_end         = buffer + buffer_size;
  395.     s->index              = 0;
           ^
  396. 
  397.     return ret;

libavcodec/get_bits.h:397:5: 
  395.     s->index              = 0;
  396. 
  397.     return ret;
           ^
  398. }
  399. 

libavcodec/get_bits.h:398:1: return from a call to init_get_bits
  396. 
  397.     return ret;
  398. }
       ^
  399. 
  400. /**

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

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

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

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