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

libavformat/mpc8.c:84:1: start of procedure mpc8_parse_seektable()
82. }
83. 
84. static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
    ^
85. {
86.     MPCContext *c = s->priv_data;

libavformat/mpc8.c:86:5: 
84. static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
85. {
86.     MPCContext *c = s->priv_data;
        ^
87.     int tag;
88.     int64_t size, pos, ppos[2];

libavformat/mpc8.c:93:5: Skipping url_fseek(): empty list of specs
91.     GetBitContext gb;
92. 
93.     url_fseek(s->pb, off, SEEK_SET);
        ^
94.     mpc8_get_chunk_header(s->pb, &tag, &size);
95.     if(tag != TAG_SEEKTABLE){

libavformat/mpc8.c:94:5: Skipping mpc8_get_chunk_header(): empty list of specs
92. 
93.     url_fseek(s->pb, off, SEEK_SET);
94.     mpc8_get_chunk_header(s->pb, &tag, &size);
        ^
95.     if(tag != TAG_SEEKTABLE){
96.         av_log(s, AV_LOG_ERROR, "No seek table at given position\n");

libavformat/mpc8.c:95:8: Taking false branch
93.     url_fseek(s->pb, off, SEEK_SET);
94.     mpc8_get_chunk_header(s->pb, &tag, &size);
95.     if(tag != TAG_SEEKTABLE){
           ^
96.         av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
97.         return;

libavformat/mpc8.c:99:10: 
 97.         return;
 98.     }
 99.     if(!(buf = av_malloc(size)))
              ^
100.         return;
101.     get_buffer(s->pb, buf, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
  40.    linker will do it automatically */
  41. 
  42. void *av_malloc(unsigned int size)
      ^
  43. {
  44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
  48. 
  49.     /* let's disallow possible ambiguous cases */
  50.     if(size > (INT_MAX-16) )
             ^
  51.         return NULL;
  52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
  59.     ((char*)ptr)[-1]= diff;
  60. #elif defined (HAVE_MEMALIGN)
  61.     ptr = memalign(16,size);
          ^
  62.     /* Why 64?
  63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
  89.     ptr = malloc(size);
  90. #endif
  91.     return ptr;
          ^
  92. }
  93. 

libavutil/mem.c:92:1: return from a call to av_malloc
  90. #endif
  91.     return ptr;
  92. }
      ^
  93. 
  94. void *av_realloc(void *ptr, unsigned int size)

libavformat/mpc8.c:99:10: Taking false branch
 97.         return;
 98.     }
 99.     if(!(buf = av_malloc(size)))
              ^
100.         return;
101.     get_buffer(s->pb, buf, size);

libavformat/mpc8.c:101:5: Skipping get_buffer(): empty list of specs
 99.     if(!(buf = av_malloc(size)))
100.         return;
101.     get_buffer(s->pb, buf, size);
         ^
102.     init_get_bits(&gb, buf, size * 8);
103.     size = gb_get_v(&gb);

libavformat/mpc8.c:102:5: 
100.         return;
101.     get_buffer(s->pb, buf, size);
102.     init_get_bits(&gb, buf, size * 8);
         ^
103.     size = gb_get_v(&gb);
104.     if(size > UINT_MAX/4 || size > c->samples/1152){

libavcodec/bitstream.h:758:1: start of procedure init_get_bits()
  756.  * @param bit_size the size of the buffer in bits
  757.  */
  758. static inline void init_get_bits(GetBitContext *s,
       ^
  759.                    const uint8_t *buffer, int bit_size)
  760. {

libavcodec/bitstream.h:761:5: 
  759.                    const uint8_t *buffer, int bit_size)
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
           ^
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:762:8: Taking true branch
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
              ^
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;

libavcodec/bitstream.h:763:9: 
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
               ^
  764.         buffer = NULL;
  765.     }

libavcodec/bitstream.h:764:9: 
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;
               ^
  765.     }
  766. 

libavcodec/bitstream.h:767:5: 
  765.     }
  766. 
  767.     s->buffer= buffer;
           ^
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:768:5: 
  766. 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
           ^
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:769:5: 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;
           ^
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;

libavcodec/bitstream.h:771:5: 
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;
           ^
  772. #elif defined LIBMPEG2_BITSTREAM_READER
  773.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:781:1: return from a call to init_get_bits
  779.     skip_bits_long(s, 0);
  780. #endif
  781. }
       ^
  782. 
  783. static inline void align_get_bits(GetBitContext *s)

libavformat/mpc8.c:103:5: 
101.     get_buffer(s->pb, buf, size);
102.     init_get_bits(&gb, buf, size * 8);
103.     size = gb_get_v(&gb);
         ^
104.     if(size > UINT_MAX/4 || size > c->samples/1152){
105.         av_log(s, AV_LOG_ERROR, "Seek table is too big\n");

libavformat/mpc8.c:60:1: start of procedure gb_get_v()
  58. }
  59. 
  60. static inline int64_t gb_get_v(GetBitContext *gb)
      ^
  61. {
  62.     int64_t v = 0;

libavformat/mpc8.c:62:5: 
  60. static inline int64_t gb_get_v(GetBitContext *gb)
  61. {
  62.     int64_t v = 0;
          ^
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){

libavformat/mpc8.c:63:5: 
  61. {
  62.     int64_t v = 0;
  63.     int bits = 0;
          ^
  64.     while(get_bits1(gb) && bits < 64-7){
  65.         v <<= 7;

libavformat/mpc8.c:64:11: 
  62.     int64_t v = 0;
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){
                ^
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);

libavcodec/bitstream.h:686:1: start of procedure get_bits1()
    684. }
    685. 
    686. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;

libavcodec/bitstream.h:688:5: 
    686. static inline unsigned int get_bits1(GetBitContext *s){
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
             ^
    689.     uint8_t result= s->buffer[ index>>3 ];
    690. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:689:5: 
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
    689.     uint8_t result= s->buffer[ index>>3 ];
             ^
    690. #ifdef ALT_BITSTREAM_READER_LE
    691.     result>>= (index&0x07);

libavcodec/bitstream.h:694:5: 
    692.     result&= 1;
    693. #else
    694.     result<<= (index&0x07);
             ^
    695.     result>>= 8 - 1;
    696. #endif

libavcodec/bitstream.h:695:5: 
    693. #else
    694.     result<<= (index&0x07);
    695.     result>>= 8 - 1;
             ^
    696. #endif
    697.     index++;

libavcodec/bitstream.h:697:5: 
    695.     result>>= 8 - 1;
    696. #endif
    697.     index++;
             ^
    698.     s->index= index;
    699. 

libavcodec/bitstream.h:698:5: 
    696. #endif
    697.     index++;
    698.     s->index= index;
             ^
    699. 
    700.     return result;

libavcodec/bitstream.h:700:5: 
    698.     s->index= index;
    699. 
    700.     return result;
             ^
    701. #else
    702.     return get_bits(s, 1);

libavcodec/bitstream.h:704:1: return from a call to get_bits1
    702.     return get_bits(s, 1);
    703. #endif
    704. }
         ^
    705. 
    706. static inline unsigned int show_bits1(GetBitContext *s){

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

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

libavformat/mpc8.c:65:9: 
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){
  65.         v <<= 7;
              ^
  66.         v |= get_bits(gb, 7);
  67.         bits += 7;

libavformat/mpc8.c:66:9: 
  64.     while(get_bits1(gb) && bits < 64-7){
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);
              ^
  67.         bits += 7;
  68.     }

libavcodec/bitstream.h:655:1: start of procedure get_bits()
    653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    654.  */
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    656.     register int tmp;
    657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
    656.     register int tmp;
    657.     OPEN_READER(re, s)
             ^
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
    656.     register int tmp;
    657.     OPEN_READER(re, s)
    658.     UPDATE_CACHE(re, s)
             ^
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
    657.     OPEN_READER(re, s)
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);
             ^
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)
             ^
    661.     CLOSE_READER(re, s)
    662.     return tmp;

libavcodec/bitstream.h:661:5: 
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)
             ^
    662.     return tmp;
    663. }

libavcodec/bitstream.h:662:5: 
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)
    662.     return tmp;
             ^
    663. }
    664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
    661.     CLOSE_READER(re, s)
    662.     return tmp;
    663. }
         ^
    664. 
    665. /**

libavformat/mpc8.c:67:9: 
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);
  67.         bits += 7;
              ^
  68.     }
  69.     v <<= 7;

libavformat/mpc8.c:64:11: 
  62.     int64_t v = 0;
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){
                ^
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);

libavcodec/bitstream.h:686:1: start of procedure get_bits1()
    684. }
    685. 
    686. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;

libavcodec/bitstream.h:688:5: 
    686. static inline unsigned int get_bits1(GetBitContext *s){
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
             ^
    689.     uint8_t result= s->buffer[ index>>3 ];
    690. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:689:5: 
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
    689.     uint8_t result= s->buffer[ index>>3 ];
             ^
    690. #ifdef ALT_BITSTREAM_READER_LE
    691.     result>>= (index&0x07);

libavcodec/bitstream.h:694:5: 
    692.     result&= 1;
    693. #else
    694.     result<<= (index&0x07);
             ^
    695.     result>>= 8 - 1;
    696. #endif

libavcodec/bitstream.h:695:5: 
    693. #else
    694.     result<<= (index&0x07);
    695.     result>>= 8 - 1;
             ^
    696. #endif
    697.     index++;

libavcodec/bitstream.h:697:5: 
    695.     result>>= 8 - 1;
    696. #endif
    697.     index++;
             ^
    698.     s->index= index;
    699. 

libavcodec/bitstream.h:698:5: 
    696. #endif
    697.     index++;
    698.     s->index= index;
             ^
    699. 
    700.     return result;

libavcodec/bitstream.h:700:5: 
    698.     s->index= index;
    699. 
    700.     return result;
             ^
    701. #else
    702.     return get_bits(s, 1);

libavcodec/bitstream.h:704:1: return from a call to get_bits1
    702.     return get_bits(s, 1);
    703. #endif
    704. }
         ^
    705. 
    706. static inline unsigned int show_bits1(GetBitContext *s){

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

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

libavformat/mpc8.c:65:9: 
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){
  65.         v <<= 7;
              ^
  66.         v |= get_bits(gb, 7);
  67.         bits += 7;

libavformat/mpc8.c:66:9: 
  64.     while(get_bits1(gb) && bits < 64-7){
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);
              ^
  67.         bits += 7;
  68.     }

libavcodec/bitstream.h:655:1: start of procedure get_bits()
    653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    654.  */
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    656.     register int tmp;
    657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
    655. static inline unsigned int get_bits(GetBitContext *s, int n){
    656.     register int tmp;
    657.     OPEN_READER(re, s)
             ^
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
    656.     register int tmp;
    657.     OPEN_READER(re, s)
    658.     UPDATE_CACHE(re, s)
             ^
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
    657.     OPEN_READER(re, s)
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);
             ^
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
    658.     UPDATE_CACHE(re, s)
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)
             ^
    661.     CLOSE_READER(re, s)
    662.     return tmp;

libavcodec/bitstream.h:661:5: 
    659.     tmp= SHOW_UBITS(re, s, n);
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)
             ^
    662.     return tmp;
    663. }

libavcodec/bitstream.h:662:5: 
    660.     LAST_SKIP_BITS(re, s, n)
    661.     CLOSE_READER(re, s)
    662.     return tmp;
             ^
    663. }
    664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
    661.     CLOSE_READER(re, s)
    662.     return tmp;
    663. }
         ^
    664. 
    665. /**

libavformat/mpc8.c:67:9: 
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);
  67.         bits += 7;
              ^
  68.     }
  69.     v <<= 7;

libavformat/mpc8.c:64:11: 
  62.     int64_t v = 0;
  63.     int bits = 0;
  64.     while(get_bits1(gb) && bits < 64-7){
                ^
  65.         v <<= 7;
  66.         v |= get_bits(gb, 7);

libavcodec/bitstream.h:686:1: start of procedure get_bits1()
    684. }
    685. 
    686. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;

libavcodec/bitstream.h:688:5: 
    686. static inline unsigned int get_bits1(GetBitContext *s){
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
             ^
    689.     uint8_t result= s->buffer[ index>>3 ];
    690. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:689:5: 
    687. #ifdef ALT_BITSTREAM_READER
    688.     int index= s->index;
    689.     uint8_t result= s->buffer[ index>>3 ];
             ^
    690. #ifdef ALT_BITSTREAM_READER_LE
    691.     result>>= (index&0x07);
