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:383:1: start of procedure init_get_bits()
  381.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  382.  */
  383. static inline void init_get_bits(GetBitContext *s,
       ^
  384.                    const uint8_t *buffer, int bit_size)
  385. {

libavcodec/get_bits.h:386:5: 
  384.                    const uint8_t *buffer, int bit_size)
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
           ^
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:387:9: Taking true branch
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
               ^
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;

libavcodec/get_bits.h:388:9: 
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;
               ^
  389.         buffer = NULL;
  390.     }

libavcodec/get_bits.h:389:9: 
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;
               ^
  390.     }
  391. 

libavcodec/get_bits.h:392:5: 
  390.     }
  391. 
  392.     s->buffer       = buffer;
           ^
  393.     s->size_in_bits = bit_size;
  394.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:393:5: 
  391. 
  392.     s->buffer       = buffer;
  393.     s->size_in_bits = bit_size;
           ^
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER

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

libavcodec/get_bits.h:396:5: 
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER
  396.     s->index        = 0;
           ^
  397. #elif defined A32_BITSTREAM_READER
  398.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:402:1: return from a call to init_get_bits
  400.     skip_bits_long(s, 0);
  401. #endif
  402. }
       ^
  403. 
  404. 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:169:1: start of procedure get_bits_count()
  167. #   define GET_CACHE(name, gb) ((uint32_t)name##_cache)
  168. 
  169. static inline int get_bits_count(const GetBitContext *s){
       ^
  170.     return s->index;
  171. }

libavcodec/get_bits.h:170:5: 
  168. 
  169. static inline int get_bits_count(const GetBitContext *s){
  170.     return s->index;
           ^
  171. }
  172. 

libavcodec/get_bits.h:171:1: return from a call to get_bits_count
  169. static inline int get_bits_count(const GetBitContext *s){
  170.     return s->index;
  171. }
       ^
  172. 
  173. 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:303:1: start of procedure get_bits1()
    301. }
    302. 
    303. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
    303. static inline unsigned int get_bits1(GetBitContext *s){
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
             ^
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
    306.     uint8_t result = s->buffer[index>>3];
             ^
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;

libavcodec/get_bits.h:308:5: 
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
             ^
    309.     result &= 1;
    310. #else

libavcodec/get_bits.h:309:5: 
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
    309.     result &= 1;
             ^
    310. #else
    311.     result <<= index & 7;

libavcodec/get_bits.h:314:5: 
    312.     result >>= 8 - 1;
    313. #endif
    314.     index++;
             ^
    315.     s->index = index;
    316. 

libavcodec/get_bits.h:315:5: 
    313. #endif
    314.     index++;
    315.     s->index = index;
             ^
    316. 
    317.     return result;

libavcodec/get_bits.h:317:5: 
    315.     s->index = index;
    316. 
    317.     return result;
             ^
    318. #else
    319.     return get_bits(s, 1);

libavcodec/get_bits.h:321:1: return from a call to get_bits1
    319.     return get_bits(s, 1);
    320. #endif
    321. }
         ^
    322. 
    323. 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:303:1: start of procedure get_bits1()
    301. }
    302. 
    303. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
    303. static inline unsigned int get_bits1(GetBitContext *s){
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
             ^
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
    306.     uint8_t result = s->buffer[index>>3];
             ^
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;

libavcodec/get_bits.h:308:5: 
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
             ^
    309.     result &= 1;
    310. #else

libavcodec/get_bits.h:309:5: 
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
    309.     result &= 1;
             ^
    310. #else
    311.     result <<= index & 7;

libavcodec/get_bits.h:314:5: 
    312.     result >>= 8 - 1;
    313. #endif
    314.     index++;
             ^
    315.     s->index = index;
    316. 

libavcodec/get_bits.h:315:5: 
    313. #endif
    314.     index++;
    315.     s->index = index;
             ^
    316. 
    317.     return result;

libavcodec/get_bits.h:317:5: 
    315.     s->index = index;
    316. 
    317.     return result;
             ^
    318. #else
    319.     return get_bits(s, 1);

libavcodec/get_bits.h:321:1: return from a call to get_bits1
    319.     return get_bits(s, 1);
    320. #endif
    321. }
         ^
    322. 
    323. 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:274:1: start of procedure get_bits()
    272.  * Read 1-25 bits.
    273.  */
    274. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    275.     register int tmp;
    276.     OPEN_READER(re, s);

libavcodec/get_bits.h:276:5: 
    274. static inline unsigned int get_bits(GetBitContext *s, int n){
    275.     register int tmp;
    276.     OPEN_READER(re, s);
             ^
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:277:5: 
    275.     register int tmp;
    276.     OPEN_READER(re, s);
    277.     UPDATE_CACHE(re, s);
             ^
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     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:278:5: 
    276.     OPEN_READER(re, s);
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);
             ^
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);

libavcodec/get_bits.h:279:5: 
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     LAST_SKIP_BITS(re, s, n);
             ^
    280.     CLOSE_READER(re, s);
    281.     return tmp;

libavcodec/get_bits.h:280:5: 
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);
             ^
    281.     return tmp;
    282. }

libavcodec/get_bits.h:281:5: 
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);
    281.     return tmp;
             ^
    282. }
    283. 

libavcodec/get_bits.h:282:1: return from a call to get_bits
    280.     CLOSE_READER(re, s);
    281.     return tmp;
    282. }
         ^
    283. 
    284. /**

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:303:1: start of procedure get_bits1()
    301. }
    302. 
    303. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
    303. static inline unsigned int get_bits1(GetBitContext *s){
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
             ^
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
    306.     uint8_t result = s->buffer[index>>3];
             ^
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
