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

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

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

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

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

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

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

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

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

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

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)

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