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

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

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

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

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

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

libavformat/mpc8.c:144:10: 
142.         return;
143.     }
144.     if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
              ^
145.         return;
146.     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(FF_INTERNAL_MEM_TYPE size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(FF_INTERNAL_MEM_TYPE 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-16) )
             ^
  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,16,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

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

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

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

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

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

libavcodec/get_bits.h:391:1: start of procedure init_get_bits()
  389.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  390.  */
  391. static inline void init_get_bits(GetBitContext *s,
       ^
  392.                    const uint8_t *buffer, int bit_size)
  393. {

libavcodec/get_bits.h:394:5: 
  392.                    const uint8_t *buffer, int bit_size)
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
           ^
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:395:9: Taking true branch
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
               ^
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;

libavcodec/get_bits.h:396:9: 
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;
               ^
  397.         buffer = NULL;
  398.     }

libavcodec/get_bits.h:397:9: 
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;
               ^
  398.     }
  399. 

libavcodec/get_bits.h:400:5: 
  398.     }
  399. 
  400.     s->buffer       = buffer;
           ^
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:401:5: 
  399. 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
           ^
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:402:5: 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;
           ^
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;

libavcodec/get_bits.h:404:5: 
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;
           ^
  405. #elif defined A32_BITSTREAM_READER
  406.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:410:1: return from a call to init_get_bits
  408.     skip_bits_long(s, 0);
  409. #endif
  410. }
       ^
  411. 
  412. static inline void align_get_bits(GetBitContext *s)

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

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

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

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

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

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
    309. }
    310. 
    311. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
    311. static inline unsigned int get_bits1(GetBitContext *s){
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
             ^
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
    314.     uint8_t result = s->buffer[index>>3];
             ^
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;

libavcodec/get_bits.h:316:5: 
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
             ^
    317.     result &= 1;
    318. #else

libavcodec/get_bits.h:317:5: 
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
    317.     result &= 1;
             ^
    318. #else
    319.     result <<= index & 7;

libavcodec/get_bits.h:322:5: 
    320.     result >>= 8 - 1;
    321. #endif
    322.     index++;
             ^
    323.     s->index = index;
    324. 

libavcodec/get_bits.h:323:5: 
    321. #endif
    322.     index++;
    323.     s->index = index;
             ^
    324. 
    325.     return result;

libavcodec/get_bits.h:325:5: 
    323.     s->index = index;
    324. 
    325.     return result;
             ^
    326. #else
    327.     return get_bits(s, 1);

libavcodec/get_bits.h:329:1: return from a call to get_bits1
    327.     return get_bits(s, 1);
    328. #endif
    329. }
         ^
    330. 
    331. static inline unsigned int show_bits1(GetBitContext *s){

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

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

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

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

libavcodec/get_bits.h:282:1: start of procedure get_bits()
    280.  * Read 1-25 bits.
    281.  */
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    283.     register int tmp;
    284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
    283.     register int tmp;
    284.     OPEN_READER(re, s);
             ^
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
    283.     register int tmp;
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
             ^
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      69.     x= (x>>16) | (x<<16);
      70.     return x;

libavutil/bswap.h:69:5: 
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
              ^
      70.     return x;
      71. }

libavutil/bswap.h:70:5: 
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
      70.     return x;
              ^
      71. }
      72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
      69.     x= (x>>16) | (x<<16);
      70.     return x;
      71. }
          ^
      72. #endif
      73. 

libavcodec/get_bits.h:286:5: 
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
             ^
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
             ^
    288.     CLOSE_READER(re, s);
    289.     return tmp;

libavcodec/get_bits.h:288:5: 
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
             ^
    289.     return tmp;
    290. }

libavcodec/get_bits.h:289:5: 
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
    289.     return tmp;
             ^
    290. }
    291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
    288.     CLOSE_READER(re, s);
    289.     return tmp;
    290. }
         ^
    291. 
    292. /**

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

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

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
    309. }
    310. 
    311. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
    311. static inline unsigned int get_bits1(GetBitContext *s){
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
             ^
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
    314.     uint8_t result = s->buffer[index>>3];
             ^
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;

libavcodec/get_bits.h:316:5: 
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
             ^
    317.     result &= 1;
    318. #else

libavcodec/get_bits.h:317:5: 
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
    317.     result &= 1;
             ^
    318. #else
    319.     result <<= index & 7;

libavcodec/get_bits.h:322:5: 
    320.     result >>= 8 - 1;
    321. #endif
    322.     index++;
             ^
    323.     s->index = index;
    324. 

libavcodec/get_bits.h:323:5: 
    321. #endif
    322.     index++;
    323.     s->index = index;
             ^
    324. 
    325.     return result;

libavcodec/get_bits.h:325:5: 
    323.     s->index = index;
    324. 
    325.     return result;
             ^
    326. #else
    327.     return get_bits(s, 1);

libavcodec/get_bits.h:329:1: return from a call to get_bits1
    327.     return get_bits(s, 1);
    328. #endif
    329. }
         ^
    330. 
    331. static inline unsigned int show_bits1(GetBitContext *s){

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

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

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

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

libavcodec/get_bits.h:282:1: start of procedure get_bits()
    280.  * Read 1-25 bits.
    281.  */
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    283.     register int tmp;
    284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
    283.     register int tmp;
    284.     OPEN_READER(re, s);
             ^
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
    283.     register int tmp;
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
             ^
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      69.     x= (x>>16) | (x<<16);
      70.     return x;

libavutil/bswap.h:69:5: 
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
              ^
      70.     return x;
      71. }

libavutil/bswap.h:70:5: 
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
      70.     return x;
              ^
      71. }
      72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
      69.     x= (x>>16) | (x<<16);
      70.     return x;
      71. }
          ^
      72. #endif
      73. 

libavcodec/get_bits.h:286:5: 
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
             ^
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
             ^
    288.     CLOSE_READER(re, s);
    289.     return tmp;

libavcodec/get_bits.h:288:5: 
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
             ^
    289.     return tmp;
    290. }

libavcodec/get_bits.h:289:5: 
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
    289.     return tmp;
             ^
    290. }
    291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
    288.     CLOSE_READER(re, s);
    289.     return tmp;
    290. }
         ^
    291. 
    292. /**

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

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

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
    309. }
    310. 
    311. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
    311. static inline unsigned int get_bits1(GetBitContext *s){
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
             ^
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
    314.     uint8_t result = s->buffer[index>>3];
             ^
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
