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 url_fseek(): empty list of specs
136.     GetBitContext gb;
137. 
138.     url_fseek(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.     url_fseek(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.     url_fseek(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.     get_buffer(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(unsigned int size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(unsigned int 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, unsigned int 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.     get_buffer(s->pb, buf, size);

libavformat/mpc8.c:146:5: Skipping get_buffer(): empty list of specs
144.     if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
145.         return;
146.     get_buffer(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.     get_buffer(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:473:1: start of procedure init_get_bits()
  471.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  472.  */
  473. static inline void init_get_bits(GetBitContext *s,
       ^
  474.                    const uint8_t *buffer, int bit_size)
  475. {

libavcodec/get_bits.h:476:5: 
  474.                    const uint8_t *buffer, int bit_size)
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
           ^
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:477:8: Taking true branch
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
              ^
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;

libavcodec/get_bits.h:478:9: 
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
               ^
  479.         buffer = NULL;
  480.     }

libavcodec/get_bits.h:479:9: 
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;
               ^
  480.     }
  481. 

libavcodec/get_bits.h:482:5: 
  480.     }
  481. 
  482.     s->buffer= buffer;
           ^
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;

libavcodec/get_bits.h:483:5: 
  481. 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
           ^
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:484:5: 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;
           ^
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;

libavcodec/get_bits.h:486:5: 
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;
           ^
  487. #elif defined LIBMPEG2_BITSTREAM_READER
  488.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/get_bits.h:496:1: return from a call to init_get_bits
  494.     skip_bits_long(s, 0);
  495. #endif
  496. }
       ^
  497. 
  498. static inline void align_get_bits(GetBitContext *s)

libavformat/mpc8.c:148:5: 
146.     get_buffer(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:393:1: start of procedure get_bits1()
    391. }
    392. 
    393. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;

libavcodec/get_bits.h:395:5: 
    393. static inline unsigned int get_bits1(GetBitContext *s){
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
             ^
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:396:5: 
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
    396.     uint8_t result= s->buffer[ index>>3 ];
             ^
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);

libavcodec/get_bits.h:398:5: 
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
             ^
    399.     result&= 1;
    400. #else

libavcodec/get_bits.h:399:5: 
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
    399.     result&= 1;
             ^
    400. #else
    401.     result<<= (index&0x07);

libavcodec/get_bits.h:404:5: 
    402.     result>>= 8 - 1;
    403. #endif
    404.     index++;
             ^
    405.     s->index= index;
    406. 

libavcodec/get_bits.h:405:5: 
    403. #endif
    404.     index++;
    405.     s->index= index;
             ^
    406. 
    407.     return result;

libavcodec/get_bits.h:407:5: 
    405.     s->index= index;
    406. 
    407.     return result;
             ^
    408. #else
    409.     return get_bits(s, 1);

libavcodec/get_bits.h:411:1: return from a call to get_bits1
    409.     return get_bits(s, 1);
    410. #endif
    411. }
         ^
    412. 
    413. 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:362:1: start of procedure get_bits()
    360.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    361.  */
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    363.     register int tmp;
    364.     OPEN_READER(re, s)

libavcodec/get_bits.h:364:5: 
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
    363.     register int tmp;
    364.     OPEN_READER(re, s)
             ^
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:365:5: 
    363.     register int tmp;
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
             ^
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)

libavutil/bswap.h:54:1: start of procedure bswap_32()
      52. 
      53. #ifndef bswap_32
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
          ^
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:56:5: 
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      57.     x= (x>>16) | (x<<16);
      58.     return x;

libavutil/bswap.h:57:5: 
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
              ^
      58.     return x;
      59. }

libavutil/bswap.h:58:5: 
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
      58.     return x;
              ^
      59. }
      60. #endif

libavutil/bswap.h:59:1: return from a call to bswap_32
      57.     x= (x>>16) | (x<<16);
      58.     return x;
      59. }
          ^
      60. #endif
      61. 

libavcodec/get_bits.h:366:5: 
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
             ^
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)

libavcodec/get_bits.h:367:5: 
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
             ^
    368.     CLOSE_READER(re, s)
    369.     return tmp;

libavcodec/get_bits.h:368:5: 
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
             ^
    369.     return tmp;
    370. }

libavcodec/get_bits.h:369:5: 
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
    369.     return tmp;
             ^
    370. }
    371. 

libavcodec/get_bits.h:370:1: return from a call to get_bits
    368.     CLOSE_READER(re, s)
    369.     return tmp;
    370. }
         ^
    371. 
    372. /**

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:393:1: start of procedure get_bits1()
    391. }
    392. 
    393. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;

libavcodec/get_bits.h:395:5: 
    393. static inline unsigned int get_bits1(GetBitContext *s){
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
             ^
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:396:5: 
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
    396.     uint8_t result= s->buffer[ index>>3 ];
             ^
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);

libavcodec/get_bits.h:398:5: 
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
             ^
    399.     result&= 1;
    400. #else

libavcodec/get_bits.h:399:5: 
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
    399.     result&= 1;
             ^
    400. #else
    401.     result<<= (index&0x07);

libavcodec/get_bits.h:404:5: 
    402.     result>>= 8 - 1;
    403. #endif
    404.     index++;
             ^
    405.     s->index= index;
    406. 

libavcodec/get_bits.h:405:5: 
    403. #endif
    404.     index++;
    405.     s->index= index;
             ^
    406. 
    407.     return result;

libavcodec/get_bits.h:407:5: 
    405.     s->index= index;
    406. 
    407.     return result;
             ^
    408. #else
    409.     return get_bits(s, 1);

libavcodec/get_bits.h:411:1: return from a call to get_bits1
    409.     return get_bits(s, 1);
    410. #endif
    411. }
         ^
    412. 
    413. 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:362:1: start of procedure get_bits()
    360.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    361.  */
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    363.     register int tmp;
    364.     OPEN_READER(re, s)

libavcodec/get_bits.h:364:5: 
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
    363.     register int tmp;
    364.     OPEN_READER(re, s)
             ^
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:365:5: 
    363.     register int tmp;
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
             ^
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)

libavutil/bswap.h:54:1: start of procedure bswap_32()
      52. 
      53. #ifndef bswap_32
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
          ^
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:56:5: 
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      57.     x= (x>>16) | (x<<16);
      58.     return x;

libavutil/bswap.h:57:5: 
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
              ^
      58.     return x;
      59. }

libavutil/bswap.h:58:5: 
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
      58.     return x;
              ^
      59. }
      60. #endif

libavutil/bswap.h:59:1: return from a call to bswap_32
      57.     x= (x>>16) | (x<<16);
      58.     return x;
      59. }
          ^
      60. #endif
      61. 

libavcodec/get_bits.h:366:5: 
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
             ^
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)

libavcodec/get_bits.h:367:5: 
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
             ^
    368.     CLOSE_READER(re, s)
    369.     return tmp;

libavcodec/get_bits.h:368:5: 
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
             ^
    369.     return tmp;
    370. }

libavcodec/get_bits.h:369:5: 
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
    369.     return tmp;
             ^
    370. }
    371. 

libavcodec/get_bits.h:370:1: return from a call to get_bits
    368.     CLOSE_READER(re, s)
    369.     return tmp;
    370. }
         ^
    371. 
    372. /**

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:393:1: start of procedure get_bits1()
    391. }
    392. 
    393. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;

libavcodec/get_bits.h:395:5: 
    393. static inline unsigned int get_bits1(GetBitContext *s){
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
             ^
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:396:5: 
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
    396.     uint8_t result= s->buffer[ index>>3 ];
             ^
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
