libavcodec/dvdsubdec.c:99: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 90 could be null and is dereferenced by call to `decode_run_8bit()` at line 99, 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/get_bits.h:306:1: start of procedure init_get_bits()
  304.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  305.  */
  306. static inline void init_get_bits(GetBitContext *s,
       ^
  307.                    const uint8_t *buffer, int bit_size)
  308. {

libavcodec/get_bits.h:309:5: 
  307.                    const uint8_t *buffer, int bit_size)
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
           ^
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:310:9: Taking true branch
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
               ^
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;

libavcodec/get_bits.h:311:9: 
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
               ^
  312.         buffer = NULL;
  313.     }

libavcodec/get_bits.h:312:9: 
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;
               ^
  313.     }
  314. 

libavcodec/get_bits.h:315:5: 
  313.     }
  314. 
  315.     s->buffer       = buffer;
           ^
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:316:5: 
  314. 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
           ^
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;

libavcodec/get_bits.h:317:5: 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
           ^
  318.     s->index        = 0;
  319. }

libavcodec/get_bits.h:318:5: 
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
           ^
  319. }
  320. 

libavcodec/get_bits.h:319:1: return from a call to init_get_bits
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
  319. }
       ^
  320. 
  321. 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/get_bits.h:162:1: start of procedure get_bits_count()
  160. #   define GET_CACHE(name, gb) ((uint32_t)name##_cache)
  161. 
  162. static inline int get_bits_count(const GetBitContext *s){
       ^
  163.     return s->index;
  164. }

libavcodec/get_bits.h:163:5: 
  161. 
  162. static inline int get_bits_count(const GetBitContext *s){
  163.     return s->index;
           ^
  164. }
  165. 

libavcodec/get_bits.h:164:1: return from a call to get_bits_count
  162. static inline int get_bits_count(const GetBitContext *s){
  163.     return s->index;
  164. }
       ^
  165. 
  166. 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 true 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:99:13: 
 97.             return -1;
 98.         if (is_8bit)
 99.             len = decode_run_8bit(&gb, &color);
                 ^
100.         else
101.             len = decode_run_2bit(&gb, &color);

libavcodec/dvdsubdec.c:59:1: start of procedure decode_run_8bit()
  57. }
  58. 
  59. static int decode_run_8bit(GetBitContext *gb, int *color)
      ^
  60. {
  61.     int len;

libavcodec/dvdsubdec.c:62:5: 
  60. {
  61.     int len;
  62.     int has_run = get_bits1(gb);
          ^
  63.     if (get_bits1(gb))
  64.         *color = get_bits(gb, 8);

libavcodec/get_bits.h:230:1: start of procedure get_bits1()
    228. }
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];

libavcodec/get_bits.h:231:5: 
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
             ^
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:232:5: 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];
             ^
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;

libavcodec/get_bits.h:234:5: 
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
             ^
    235.     result &= 1;
    236. #else

libavcodec/get_bits.h:235:5: 
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
    235.     result &= 1;
             ^
    236. #else
    237.     result <<= index & 7;

libavcodec/get_bits.h:240:5: 
    238.     result >>= 8 - 1;
    239. #endif
    240.     index++;
             ^
    241.     s->index = index;
    242. 

libavcodec/get_bits.h:241:5: 
    239. #endif
    240.     index++;
    241.     s->index = index;
             ^
    242. 
    243.     return result;

libavcodec/get_bits.h:243:5: 
    241.     s->index = index;
    242. 
    243.     return result;
             ^
    244. }
    245. 

libavcodec/get_bits.h:244:1: return from a call to get_bits1
    242. 
    243.     return result;
    244. }
         ^
    245. 
    246. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/dvdsubdec.c:63:9: 
  61.     int len;
  62.     int has_run = get_bits1(gb);
  63.     if (get_bits1(gb))
              ^
  64.         *color = get_bits(gb, 8);
  65.     else

libavcodec/get_bits.h:230:1: start of procedure get_bits1()
    228. }
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];

libavcodec/get_bits.h:231:5: 
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
             ^
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:232:5: 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];
             ^
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;

libavcodec/get_bits.h:234:5: 
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
             ^
    235.     result &= 1;
    236. #else

libavcodec/get_bits.h:235:5: 
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
    235.     result &= 1;
             ^
    236. #else
    237.     result <<= index & 7;

libavcodec/get_bits.h:240:5: 
    238.     result >>= 8 - 1;
    239. #endif
    240.     index++;
             ^
    241.     s->index = index;
    242. 

libavcodec/get_bits.h:241:5: 
    239. #endif
    240.     index++;
    241.     s->index = index;
             ^
    242. 
    243.     return result;

libavcodec/get_bits.h:243:5: 
    241.     s->index = index;
    242. 
    243.     return result;
             ^
    244. }
    245. 

libavcodec/get_bits.h:244:1: return from a call to get_bits1
    242. 
    243.     return result;
    244. }
         ^
    245. 
    246. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/dvdsubdec.c:63:9: Taking false branch
  61.     int len;
  62.     int has_run = get_bits1(gb);
  63.     if (get_bits1(gb))
              ^
  64.         *color = get_bits(gb, 8);
  65.     else

libavcodec/dvdsubdec.c:66:9: 
  64.         *color = get_bits(gb, 8);
  65.     else
  66.         *color = get_bits(gb, 2);
              ^
  67.     if (has_run) {
  68.         if (get_bits1(gb)) {

libavcodec/get_bits.h:201:1: start of procedure get_bits()
    199.  * Read 1-25 bits.
    200.  */
    201. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    202.     register int tmp;
    203.     OPEN_READER(re, s);

libavcodec/get_bits.h:203:5: 
    201. static inline unsigned int get_bits(GetBitContext *s, int n){
    202.     register int tmp;
    203.     OPEN_READER(re, s);
             ^
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:204:5: 
    202.     register int tmp;
    203.     OPEN_READER(re, s);
    204.     UPDATE_CACHE(re, s);
             ^
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     LAST_SKIP_BITS(re, s, n);

libavutil/bswap.h:66:1: start of procedure av_bswap32()
      64. 
      65. #ifndef av_bswap32
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
          ^
      67. {
      68.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     return AV_BSWAP32C(x);
              ^
      69. }
      70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
      67. {
      68.     return AV_BSWAP32C(x);
      69. }
          ^
      70. #endif
      71. 

libavcodec/get_bits.h:205:5: 
    203.     OPEN_READER(re, s);
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);
             ^
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);

libavcodec/get_bits.h:206:5: 
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     LAST_SKIP_BITS(re, s, n);
             ^
    207.     CLOSE_READER(re, s);
    208.     return tmp;

libavcodec/get_bits.h:207:5: 
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);
             ^
    208.     return tmp;
    209. }

libavcodec/get_bits.h:208:5: 
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);
    208.     return tmp;
             ^
    209. }
    210. 

libavcodec/get_bits.h:209:1: return from a call to get_bits
    207.     CLOSE_READER(re, s);
    208.     return tmp;
    209. }
         ^
    210. 
    211. /**

libavcodec/dvdsubdec.c:67:9: Taking true branch
  65.     else
  66.         *color = get_bits(gb, 2);
  67.     if (has_run) {
              ^
  68.         if (get_bits1(gb)) {
  69.             len = get_bits(gb, 7);

libavcodec/dvdsubdec.c:68:13: 
  66.         *color = get_bits(gb, 2);
  67.     if (has_run) {
  68.         if (get_bits1(gb)) {
                  ^
  69.             len = get_bits(gb, 7);
  70.             if (len == 0)

libavcodec/get_bits.h:230:1: start of procedure get_bits1()
    228. }
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];

libavcodec/get_bits.h:231:5: 
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
             ^
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:232:5: 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];
             ^
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
