libavcodec/mlpdec.c:990: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 968 could be null and is dereferenced by call to `get_bits1()` at line 990, column 29.

libavcodec/mlpdec.c:945:1: start of procedure read_access_unit()
943.  *  otherwise the number of bytes consumed. */
944. 
945. static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
     ^
946.                             AVPacket *avpkt)
947. {

libavcodec/mlpdec.c:948:5: 
946.                             AVPacket *avpkt)
947. {
948.     const uint8_t *buf = avpkt->data;
         ^
949.     int buf_size = avpkt->size;
950.     MLPDecodeContext *m = avctx->priv_data;

libavcodec/mlpdec.c:949:5: 
947. {
948.     const uint8_t *buf = avpkt->data;
949.     int buf_size = avpkt->size;
         ^
950.     MLPDecodeContext *m = avctx->priv_data;
951.     GetBitContext gb;

libavcodec/mlpdec.c:950:5: 
948.     const uint8_t *buf = avpkt->data;
949.     int buf_size = avpkt->size;
950.     MLPDecodeContext *m = avctx->priv_data;
         ^
951.     GetBitContext gb;
952.     unsigned int length, substr;

libavcodec/mlpdec.c:954:5: 
952.     unsigned int length, substr;
953.     unsigned int substream_start;
954.     unsigned int header_size = 4;
         ^
955.     unsigned int substr_header_size = 0;
956.     uint8_t substream_parity_present[MAX_SUBSTREAMS];

libavcodec/mlpdec.c:955:5: 
953.     unsigned int substream_start;
954.     unsigned int header_size = 4;
955.     unsigned int substr_header_size = 0;
         ^
956.     uint8_t substream_parity_present[MAX_SUBSTREAMS];
957.     uint16_t substream_data_len[MAX_SUBSTREAMS];

libavcodec/mlpdec.c:960:9: Taking false branch
958.     uint8_t parity_bits;
959. 
960.     if (buf_size < 4)
             ^
961.         return 0;
962. 

libavcodec/mlpdec.c:963:5: 
961.         return 0;
962. 
963.     length = (AV_RB16(buf) & 0xfff) * 2;
         ^
964. 
965.     if (length < 4 || length > buf_size)

libavutil/bswap.h:58:1: start of procedure av_bswap16()
  56. 
  57. #ifndef av_bswap16
  58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
      ^
  59. {
  60.     x= (x>>8) | (x<<8);

libavutil/bswap.h:60:5: 
  58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
  59. {
  60.     x= (x>>8) | (x<<8);
          ^
  61.     return x;
  62. }

libavutil/bswap.h:61:5: 
  59. {
  60.     x= (x>>8) | (x<<8);
  61.     return x;
          ^
  62. }
  63. #endif

libavutil/bswap.h:62:1: return from a call to av_bswap16
  60.     x= (x>>8) | (x<<8);
  61.     return x;
  62. }
      ^
  63. #endif
  64. 

libavcodec/mlpdec.c:965:9: Taking false branch
963.     length = (AV_RB16(buf) & 0xfff) * 2;
964. 
965.     if (length < 4 || length > buf_size)
             ^
966.         return -1;
967. 

libavcodec/mlpdec.c:965:23: Taking false branch
963.     length = (AV_RB16(buf) & 0xfff) * 2;
964. 
965.     if (length < 4 || length > buf_size)
                           ^
966.         return -1;
967. 

libavcodec/mlpdec.c:968:5: 
966.         return -1;
967. 
968.     init_get_bits(&gb, (buf + 4), (length - 4) * 8);
         ^
969. 
970.     m->is_major_sync_unit = 0;

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)

libavcodec/mlpdec.c:970:5: 
968.     init_get_bits(&gb, (buf + 4), (length - 4) * 8);
969. 
970.     m->is_major_sync_unit = 0;
         ^
971.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
972.         if (read_major_sync(m, &gb) < 0)

libavcodec/mlpdec.c:971:9: 
969. 
970.     m->is_major_sync_unit = 0;
971.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
             ^
972.         if (read_major_sync(m, &gb) < 0)
973.             goto error;

libavcodec/get_bits.h:447:1: start of procedure show_bits_long()
  445.  * shows 0-32 bits.
  446.  */
  447. static inline unsigned int show_bits_long(GetBitContext *s, int n){
       ^
  448.     if(n<=MIN_CACHE_BITS) return show_bits(s, n);
  449.     else{

libavcodec/get_bits.h:448:8: Taking false branch
  446.  */
  447. static inline unsigned int show_bits_long(GetBitContext *s, int n){
  448.     if(n<=MIN_CACHE_BITS) return show_bits(s, n);
              ^
  449.     else{
  450.         GetBitContext gb= *s;

libavcodec/get_bits.h:450:9: 
  448.     if(n<=MIN_CACHE_BITS) return show_bits(s, n);
  449.     else{
  450.         GetBitContext gb= *s;
               ^
  451.         return get_bits_long(&gb, n);
  452.     }

libavcodec/get_bits.h:451:9: 
  449.     else{
  450.         GetBitContext gb= *s;
  451.         return get_bits_long(&gb, n);
               ^
  452.     }
  453. }

libavcodec/get_bits.h:424:1: start of procedure get_bits_long()
    422.  * reads 0-32 bits.
    423.  */
    424. static inline unsigned int get_bits_long(GetBitContext *s, int n){
         ^
    425.     if(n<=MIN_CACHE_BITS) return get_bits(s, n);
    426.     else{

libavcodec/get_bits.h:425:8: Taking false branch
    423.  */
    424. static inline unsigned int get_bits_long(GetBitContext *s, int n){
    425.     if(n<=MIN_CACHE_BITS) return get_bits(s, n);
                ^
    426.     else{
    427. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:431:9: 
    429.         return ret | (get_bits(s, n-16) << 16);
    430. #else
    431.         int ret= get_bits(s, 16) << (n-16);
                 ^
    432.         return ret | get_bits(s, n-16);
    433. #endif

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

libavcodec/get_bits.h:432:9: 
    430. #else
    431.         int ret= get_bits(s, 16) << (n-16);
    432.         return ret | get_bits(s, n-16);
                 ^
    433. #endif
    434.     }

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

libavcodec/get_bits.h:435:1: return from a call to get_bits_long
    433. #endif
    434.     }
    435. }
         ^
    436. 
    437. /**

libavcodec/get_bits.h:453:1: return from a call to show_bits_long
  451.         return get_bits_long(&gb, n);
  452.     }
  453. }
       ^
  454. 
  455. static inline int check_marker(GetBitContext *s, const char *msg)

libavcodec/mlpdec.c:971:9: Taking false branch
969. 
970.     m->is_major_sync_unit = 0;
971.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
             ^
972.         if (read_major_sync(m, &gb) < 0)
973.             goto error;

libavcodec/mlpdec.c:978:10: Taking false branch
976.     }
977. 
978.     if (!m->params_valid) {
              ^
979.         av_log(m->avctx, AV_LOG_WARNING,
980.                "Stream parameters not seen; skipping frame.\n");

libavcodec/mlpdec.c:985:5: 
983.     }
984. 
985.     substream_start = 0;
         ^
986. 
987.     for (substr = 0; substr < m->num_substreams; substr++) {

libavcodec/mlpdec.c:987:10: 
985.     substream_start = 0;
986. 
987.     for (substr = 0; substr < m->num_substreams; substr++) {
              ^
988.         int extraword_present, checkdata_present, end, nonrestart_substr;
989. 

libavcodec/mlpdec.c:987:22: Loop condition is true. Entering loop body
985.     substream_start = 0;
986. 
987.     for (substr = 0; substr < m->num_substreams; substr++) {
                          ^
988.         int extraword_present, checkdata_present, end, nonrestart_substr;
989. 

libavcodec/mlpdec.c:990:9: 
988.         int extraword_present, checkdata_present, end, nonrestart_substr;
989. 
990.         extraword_present = get_bits1(&gb);
             ^
991.         nonrestart_substr = get_bits1(&gb);
992.         checkdata_present = get_bits1(&gb);

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