libavformat/mpc8.c:150: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 149 could be null and is dereferenced by call to `gb_get_v()` at line 150, column 12.

libavformat/mpc8.c:131:1: start of procedure mpc8_parse_seektable()
129. }
130. 
131. static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
     ^
132. {
133.     MPCContext *c = s->priv_data;

libavformat/mpc8.c:133:5: 
131. static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
132. {
133.     MPCContext *c = s->priv_data;
         ^
134.     int tag;
135.     int64_t size, pos, ppos[2];

libavformat/mpc8.c:140:5: Skipping avio_seek(): empty list of specs
138.     GetBitContext gb;
139. 
140.     avio_seek(s->pb, off, SEEK_SET);
         ^
141.     mpc8_get_chunk_header(s->pb, &tag, &size);
142.     if(tag != TAG_SEEKTABLE){

libavformat/mpc8.c:141:5: Skipping mpc8_get_chunk_header(): empty list of specs
139. 
140.     avio_seek(s->pb, off, SEEK_SET);
141.     mpc8_get_chunk_header(s->pb, &tag, &size);
         ^
142.     if(tag != TAG_SEEKTABLE){
143.         av_log(s, AV_LOG_ERROR, "No seek table at given position\n");

libavformat/mpc8.c:142:8: Taking false branch
140.     avio_seek(s->pb, off, SEEK_SET);
141.     mpc8_get_chunk_header(s->pb, &tag, &size);
142.     if(tag != TAG_SEEKTABLE){
            ^
143.         av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
144.         return;

libavformat/mpc8.c:146:10: 
144.         return;
145.     }
146.     if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
              ^
147.         return;
148.     avio_read(s->pb, buf, size);

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(size_t size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(size_t size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking false branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavformat/mpc8.c:146:10: Taking false branch
144.         return;
145.     }
146.     if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
              ^
147.         return;
148.     avio_read(s->pb, buf, size);

libavformat/mpc8.c:148:5: Skipping avio_read(): empty list of specs
146.     if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
147.         return;
148.     avio_read(s->pb, buf, size);
         ^
149.     init_get_bits(&gb, buf, size * 8);
150.     size = gb_get_v(&gb);

libavformat/mpc8.c:149:5: 
147.         return;
148.     avio_read(s->pb, buf, size);
149.     init_get_bits(&gb, buf, size * 8);
         ^
150.     size = gb_get_v(&gb);
151.     if(size > UINT_MAX/4 || size > c->samples/1152){

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)

libavformat/mpc8.c:150:5: 
148.     avio_read(s->pb, buf, size);
149.     init_get_bits(&gb, buf, size * 8);
150.     size = gb_get_v(&gb);
         ^
151.     if(size > UINT_MAX/4 || size > c->samples/1152){
152.         av_log(s, AV_LOG_ERROR, "Seek table is too big\n");

libavformat/mpc8.c:107:1: start of procedure gb_get_v()
  105. }
  106. 
  107. static inline int64_t gb_get_v(GetBitContext *gb)
       ^
  108. {
  109.     int64_t v = 0;

libavformat/mpc8.c:109:5: 
  107. static inline int64_t gb_get_v(GetBitContext *gb)
  108. {
  109.     int64_t v = 0;
           ^
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){

libavformat/mpc8.c:110:5: 
  108. {
  109.     int64_t v = 0;
  110.     int bits = 0;
           ^
  111.     while(get_bits1(gb) && bits < 64-7){
  112.         v <<= 7;

libavformat/mpc8.c:111:11: 
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                 ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

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){

libavformat/mpc8.c:111:11: Loop condition is true. Entering loop body
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                 ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

libavformat/mpc8.c:111:28: Loop condition is true. Entering loop body
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                                  ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

libavformat/mpc8.c:112:9: 
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
  112.         v <<= 7;
               ^
  113.         v |= get_bits(gb, 7);
  114.         bits += 7;

libavformat/mpc8.c:113:9: 
  111.     while(get_bits1(gb) && bits < 64-7){
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);
               ^
  114.         bits += 7;
  115.     }

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. /**

libavformat/mpc8.c:114:9: 
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);
  114.         bits += 7;
               ^
  115.     }
  116.     v <<= 7;

libavformat/mpc8.c:111:11: 
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                 ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

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){

libavformat/mpc8.c:111:11: Loop condition is true. Entering loop body
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                 ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

libavformat/mpc8.c:111:28: Loop condition is true. Entering loop body
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                                  ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

libavformat/mpc8.c:112:9: 
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
  112.         v <<= 7;
               ^
  113.         v |= get_bits(gb, 7);
  114.         bits += 7;

libavformat/mpc8.c:113:9: 
  111.     while(get_bits1(gb) && bits < 64-7){
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);
               ^
  114.         bits += 7;
  115.     }

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. /**

libavformat/mpc8.c:114:9: 
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);
  114.         bits += 7;
               ^
  115.     }
  116.     v <<= 7;

libavformat/mpc8.c:111:11: 
  109.     int64_t v = 0;
  110.     int bits = 0;
  111.     while(get_bits1(gb) && bits < 64-7){
                 ^
  112.         v <<= 7;
  113.         v |= get_bits(gb, 7);

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;
