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

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

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

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

libavcodec/mss2.c:470:5: 
468.     const uint8_t *buf = avpkt->data;
469.     int buf_size       = avpkt->size;
470.     MSS2Context *ctx = avctx->priv_data;
         ^
471.     MSS12Context *c  = &ctx->c;
472.     GetBitContext gb;

libavcodec/mss2.c:471:5: 
469.     int buf_size       = avpkt->size;
470.     MSS2Context *ctx = avctx->priv_data;
471.     MSS12Context *c  = &ctx->c;
         ^
472.     GetBitContext gb;
473.     GetByteContext gB;

libavcodec/mss2.c:479:5: 
477. 
478.     Rectangle wmv9rects[MAX_WMV9_RECTANGLES], *r;
479.     int used_rects = 0, i, implicit_rect = 0, av_uninit(wmv9_mask);
         ^
480. 
481.     av_assert0(FF_INPUT_BUFFER_PADDING_SIZE >=

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

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

libavcodec/mss2.c:484:5: 
482.                ARITH2_PADDING + (MIN_CACHE_BITS + 7) / 8);
483. 
484.     init_get_bits(&gb, buf, buf_size * 8);
         ^
485. 
486.     if (keyframe = get_bits1(&gb))

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/mss2.c:486:9: 
484.     init_get_bits(&gb, buf, buf_size * 8);
485. 
486.     if (keyframe = get_bits1(&gb))
             ^
487.         skip_bits(&gb, 7);
488.     has_wmv9 = 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;
