libavcodec/dvdsubdec.c:101: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 90 could be null and is dereferenced by call to `decode_run_2bit()` at line 101, column 19.

libavcodec/dvdsubdec.c:81:1: start of procedure decode_rle()
79. }
80. 
81. static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
    ^
82.                       const uint8_t *buf, int start, int buf_size, int is_8bit)
83. {

libavcodec/dvdsubdec.c:89:5: 
87.     uint8_t *d;
88. 
89.     bit_len = (buf_size - start) * 8;
        ^
90.     init_get_bits(&gb, buf + start, bit_len);
91. 

libavcodec/dvdsubdec.c:90:5: 
88. 
89.     bit_len = (buf_size - start) * 8;
90.     init_get_bits(&gb, buf + start, bit_len);
        ^
91. 
92.     x = 0;

libavcodec/bitstream.h:758:1: start of procedure init_get_bits()
  756.  * @param bit_size the size of the buffer in bits
  757.  */
  758. static inline void init_get_bits(GetBitContext *s,
       ^
  759.                    const uint8_t *buffer, int bit_size)
  760. {

libavcodec/bitstream.h:761:5: 
  759.                    const uint8_t *buffer, int bit_size)
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
           ^
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:762:8: Taking true branch
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
              ^
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;

libavcodec/bitstream.h:763:9: 
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
               ^
  764.         buffer = NULL;
  765.     }

libavcodec/bitstream.h:764:9: 
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;
               ^
  765.     }
  766. 

libavcodec/bitstream.h:767:5: 
  765.     }
  766. 
  767.     s->buffer= buffer;
           ^
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:768:5: 
  766. 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
           ^
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:769:5: 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;
           ^
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;

libavcodec/bitstream.h:771:5: 
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;
           ^
  772. #elif defined LIBMPEG2_BITSTREAM_READER
  773.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:781:1: return from a call to init_get_bits
  779.     skip_bits_long(s, 0);
  780. #endif
  781. }
       ^
  782. 
  783. static inline void align_get_bits(GetBitContext *s)

libavcodec/dvdsubdec.c:92:5: 
90.     init_get_bits(&gb, buf + start, bit_len);
91. 
92.     x = 0;
        ^
93.     y = 0;
94.     d = bitmap;

libavcodec/dvdsubdec.c:93:5: 
91. 
92.     x = 0;
93.     y = 0;
        ^
94.     d = bitmap;
95.     for(;;) {

libavcodec/dvdsubdec.c:94:5: 
92.     x = 0;
93.     y = 0;
94.     d = bitmap;
        ^
95.     for(;;) {
96.         if (get_bits_count(&gb) > bit_len)

libavcodec/dvdsubdec.c:114:5: Loop condition is true. Entering loop body
112.             align_get_bits(&gb);
113.         }
114.     }
         ^
115.     return 0;
116. }

libavcodec/dvdsubdec.c:96:13: 
94.     d = bitmap;
95.     for(;;) {
96.         if (get_bits_count(&gb) > bit_len)
                ^
97.             return -1;
98.         if (is_8bit)

libavcodec/bitstream.h:464:1: start of procedure get_bits_count()
  462.         ((uint32_t)name##_cache)
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
       ^
  465.     return s->index;
  466. }

libavcodec/bitstream.h:465:5: 
  463. 
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
           ^
  466. }
  467. 

libavcodec/bitstream.h:466:1: return from a call to get_bits_count
  464. static inline int get_bits_count(GetBitContext *s){
  465.     return s->index;
  466. }
       ^
  467. 
  468. static inline void skip_bits_long(GetBitContext *s, int n){

libavcodec/dvdsubdec.c:96:13: Taking false branch
94.     d = bitmap;
95.     for(;;) {
96.         if (get_bits_count(&gb) > bit_len)
                ^
97.             return -1;
98.         if (is_8bit)

libavcodec/dvdsubdec.c:98:13: Taking false branch
 96.         if (get_bits_count(&gb) > bit_len)
 97.             return -1;
 98.         if (is_8bit)
                 ^
 99.             len = decode_run_8bit(&gb, &color);
100.         else

libavcodec/dvdsubdec.c:101:13: 
 99.             len = decode_run_8bit(&gb, &color);
100.         else
101.             len = decode_run_2bit(&gb, &color);
                 ^
102.         len = FFMIN(len, w - x);
103.         memset(d + x, color, len);

libavcodec/dvdsubdec.c:45:1: start of procedure decode_run_2bit()
  43. }
  44. 
  45. static int decode_run_2bit(GetBitContext *gb, int *color)
      ^
  46. {
  47.     unsigned int v, t;

libavcodec/dvdsubdec.c:49:5: 
  47.     unsigned int v, t;
  48. 
  49.     v = 0;
          ^
  50.     for (t = 1; v < t && t <= 0x40; t <<= 2)
  51.         v = (v << 4) | get_bits(gb, 4);

libavcodec/dvdsubdec.c:50:10: 
  48. 
  49.     v = 0;
  50.     for (t = 1; v < t && t <= 0x40; t <<= 2)
               ^
  51.         v = (v << 4) | get_bits(gb, 4);
  52.     *color = v & 3;

libavcodec/dvdsubdec.c:50:17: Loop condition is true. Entering loop body
  48. 
  49.     v = 0;
  50.     for (t = 1; v < t && t <= 0x40; t <<= 2)
                      ^
  51.         v = (v << 4) | get_bits(gb, 4);
  52.     *color = v & 3;

libavcodec/dvdsubdec.c:50:26: Loop condition is true. Entering loop body
  48. 
  49.     v = 0;
  50.     for (t = 1; v < t && t <= 0x40; t <<= 2)
                               ^
  51.         v = (v << 4) | get_bits(gb, 4);
  52.     *color = v & 3;

libavcodec/dvdsubdec.c:51:9: 
  49.     v = 0;
  50.     for (t = 1; v < t && t <= 0x40; t <<= 2)
  51.         v = (v << 4) | get_bits(gb, 4);
              ^
  52.     *color = v & 3;
  53.     if (v < 4) { /* Code for fill rest of line */

libavcodec/bitstream.h:655:1: start of procedure get_bits()
    653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    654.  */
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    656.     register int tmp;
    657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
    656.     register int tmp;
    657.     OPEN_READER(re, s)
             ^
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
    656.     register int tmp;
    657.     OPEN_READER(re, s)
    658.     UPDATE_CACHE(re, s)
             ^
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)
