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

libavcodec/mlpdec.c:957:1: start of procedure read_access_unit()
955.  *  otherwise the number of bytes consumed. */
956. 
957. static int read_access_unit(AVCodecContext *avctx, void* data,
     ^
958.                             int *got_frame_ptr, AVPacket *avpkt)
959. {

libavcodec/mlpdec.c:960:5: 
958.                             int *got_frame_ptr, AVPacket *avpkt)
959. {
960.     const uint8_t *buf = avpkt->data;
         ^
961.     int buf_size = avpkt->size;
962.     MLPDecodeContext *m = avctx->priv_data;

libavcodec/mlpdec.c:961:5: 
959. {
960.     const uint8_t *buf = avpkt->data;
961.     int buf_size = avpkt->size;
         ^
962.     MLPDecodeContext *m = avctx->priv_data;
963.     GetBitContext gb;

libavcodec/mlpdec.c:962:5: 
960.     const uint8_t *buf = avpkt->data;
961.     int buf_size = avpkt->size;
962.     MLPDecodeContext *m = avctx->priv_data;
         ^
963.     GetBitContext gb;
964.     unsigned int length, substr;

libavcodec/mlpdec.c:966:5: 
964.     unsigned int length, substr;
965.     unsigned int substream_start;
966.     unsigned int header_size = 4;
         ^
967.     unsigned int substr_header_size = 0;
968.     uint8_t substream_parity_present[MAX_SUBSTREAMS];

libavcodec/mlpdec.c:967:5: 
965.     unsigned int substream_start;
966.     unsigned int header_size = 4;
967.     unsigned int substr_header_size = 0;
         ^
968.     uint8_t substream_parity_present[MAX_SUBSTREAMS];
969.     uint16_t substream_data_len[MAX_SUBSTREAMS];

libavcodec/mlpdec.c:973:9: Taking false branch
971.     int ret;
972. 
973.     if (buf_size < 4)
             ^
974.         return 0;
975. 

libavcodec/mlpdec.c:976:5: 
974.         return 0;
975. 
976.     length = (AV_RB16(buf) & 0xfff) * 2;
         ^
977. 
978.     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:978:9: Taking false branch
976.     length = (AV_RB16(buf) & 0xfff) * 2;
977. 
978.     if (length < 4 || length > buf_size)
             ^
979.         return AVERROR_INVALIDDATA;
980. 

libavcodec/mlpdec.c:978:23: Taking false branch
976.     length = (AV_RB16(buf) & 0xfff) * 2;
977. 
978.     if (length < 4 || length > buf_size)
                           ^
979.         return AVERROR_INVALIDDATA;
980. 

libavcodec/mlpdec.c:981:5: 
979.         return AVERROR_INVALIDDATA;
980. 
981.     init_get_bits(&gb, (buf + 4), (length - 4) * 8);
         ^
982. 
983.     m->is_major_sync_unit = 0;

libavcodec/get_bits.h:343:1: start of procedure init_get_bits()
  341.  * @param bit_size the size of the buffer in bits
  342.  */
  343. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
       ^
  344.                                  int bit_size)
  345. {

libavcodec/get_bits.h:346:5: 
  344.                                  int bit_size)
  345. {
  346.     int buffer_size = (bit_size+7)>>3;
           ^
  347.     if (buffer_size < 0 || bit_size < 0) {
  348.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:347:9: Taking true branch
  345. {
  346.     int buffer_size = (bit_size+7)>>3;
  347.     if (buffer_size < 0 || bit_size < 0) {
               ^
  348.         buffer_size = bit_size = 0;
  349.         buffer = NULL;

libavcodec/get_bits.h:348:9: 
  346.     int buffer_size = (bit_size+7)>>3;
  347.     if (buffer_size < 0 || bit_size < 0) {
  348.         buffer_size = bit_size = 0;
               ^
  349.         buffer = NULL;
  350.     }

libavcodec/get_bits.h:349:9: 
  347.     if (buffer_size < 0 || bit_size < 0) {
  348.         buffer_size = bit_size = 0;
  349.         buffer = NULL;
               ^
  350.     }
  351. 

libavcodec/get_bits.h:352:5: 
  350.     }
  351. 
  352.     s->buffer       = buffer;
           ^
  353.     s->size_in_bits = bit_size;
  354. #if !UNCHECKED_BITSTREAM_READER

libavcodec/get_bits.h:353:5: 
  351. 
  352.     s->buffer       = buffer;
  353.     s->size_in_bits = bit_size;
           ^
  354. #if !UNCHECKED_BITSTREAM_READER
  355.     s->size_in_bits_plus8 = bit_size + 8;

libavcodec/get_bits.h:355:5: 
  353.     s->size_in_bits = bit_size;
  354. #if !UNCHECKED_BITSTREAM_READER
  355.     s->size_in_bits_plus8 = bit_size + 8;
           ^
  356. #endif
  357.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:357:5: 
  355.     s->size_in_bits_plus8 = bit_size + 8;
  356. #endif
  357.     s->buffer_end   = buffer + buffer_size;
           ^
  358.     s->index        = 0;
  359. }

libavcodec/get_bits.h:358:5: 
  356. #endif
  357.     s->buffer_end   = buffer + buffer_size;
  358.     s->index        = 0;
           ^
  359. }
  360. 

libavcodec/get_bits.h:359:1: return from a call to init_get_bits
  357.     s->buffer_end   = buffer + buffer_size;
  358.     s->index        = 0;
  359. }
       ^
  360. 
  361. static inline void align_get_bits(GetBitContext *s)

libavcodec/mlpdec.c:983:5: 
981.     init_get_bits(&gb, (buf + 4), (length - 4) * 8);
982. 
983.     m->is_major_sync_unit = 0;
         ^
984.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
985.         if (read_major_sync(m, &gb) < 0)

libavcodec/mlpdec.c:984:9: 
982. 
983.     m->is_major_sync_unit = 0;
984.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
             ^
985.         if (read_major_sync(m, &gb) < 0)
986.             goto error;

libavcodec/get_bits.h:318:1: start of procedure show_bits_long()
  316.  * Show 0-32 bits.
  317.  */
  318. static inline unsigned int show_bits_long(GetBitContext *s, int n)
       ^
  319. {
  320.     if (n <= MIN_CACHE_BITS)

libavcodec/get_bits.h:320:9: Taking false branch
  318. static inline unsigned int show_bits_long(GetBitContext *s, int n)
  319. {
  320.     if (n <= MIN_CACHE_BITS)
               ^
  321.         return show_bits(s, n);
  322.     else {

libavcodec/get_bits.h:323:9: 
  321.         return show_bits(s, n);
  322.     else {
  323.         GetBitContext gb = *s;
               ^
  324.         return get_bits_long(&gb, n);
  325.     }

libavcodec/get_bits.h:324:9: 
  322.     else {
  323.         GetBitContext gb = *s;
  324.         return get_bits_long(&gb, n);
               ^
  325.     }
  326. }

libavcodec/get_bits.h:292:1: start of procedure get_bits_long()
    290.  * Read 0-32 bits.
    291.  */
    292. static inline unsigned int get_bits_long(GetBitContext *s, int n)
         ^
    293. {
    294.     if (n <= MIN_CACHE_BITS)

libavcodec/get_bits.h:294:9: Taking false branch
    292. static inline unsigned int get_bits_long(GetBitContext *s, int n)
    293. {
    294.     if (n <= MIN_CACHE_BITS)
                 ^
    295.         return get_bits(s, n);
    296.     else {

libavcodec/get_bits.h:301:9: 
    299.         return ret | (get_bits(s, n-16) << 16);
    300. #else
    301.         int ret = get_bits(s, 16) << (n-16);
                 ^
    302.         return ret | get_bits(s, n-16);
    303. #endif

libavcodec/get_bits.h:228:1: start of procedure get_bits()
      226.  * Read 1-25 bits.
      227.  */
      228. static inline unsigned int get_bits(GetBitContext *s, int n)
           ^
      229. {
      230.     register int tmp;

libavcodec/get_bits.h:231:5: 
      229. {
      230.     register int tmp;
      231.     OPEN_READER(re, s);
               ^
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:232:5: 
      230.     register int tmp;
      231.     OPEN_READER(re, s);
      232.     UPDATE_CACHE(re, s);
               ^
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     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:233:5: 
      231.     OPEN_READER(re, s);
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);
               ^
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);

libavcodec/get_bits.h:234:5: Condition is true
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     LAST_SKIP_BITS(re, s, n);
               ^
      235.     CLOSE_READER(re, s);
      236.     return tmp;

libavcodec/get_bits.h:235:5: 
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);
               ^
      236.     return tmp;
      237. }

libavcodec/get_bits.h:236:5: 
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);
      236.     return tmp;
               ^
      237. }
      238. 

libavcodec/get_bits.h:237:1: return from a call to get_bits
      235.     CLOSE_READER(re, s);
      236.     return tmp;
      237. }
           ^
      238. 
      239. /**

libavcodec/get_bits.h:302:9: 
    300. #else
    301.         int ret = get_bits(s, 16) << (n-16);
    302.         return ret | get_bits(s, n-16);
                 ^
    303. #endif
    304.     }

libavcodec/get_bits.h:228:1: start of procedure get_bits()
      226.  * Read 1-25 bits.
      227.  */
      228. static inline unsigned int get_bits(GetBitContext *s, int n)
           ^
      229. {
      230.     register int tmp;

libavcodec/get_bits.h:231:5: 
      229. {
      230.     register int tmp;
      231.     OPEN_READER(re, s);
               ^
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:232:5: 
      230.     register int tmp;
      231.     OPEN_READER(re, s);
      232.     UPDATE_CACHE(re, s);
               ^
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     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:233:5: 
      231.     OPEN_READER(re, s);
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);
               ^
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);

libavcodec/get_bits.h:234:5: Condition is true
      232.     UPDATE_CACHE(re, s);
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     LAST_SKIP_BITS(re, s, n);
               ^
      235.     CLOSE_READER(re, s);
      236.     return tmp;

libavcodec/get_bits.h:235:5: 
      233.     tmp = SHOW_UBITS(re, s, n);
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);
               ^
      236.     return tmp;
      237. }

libavcodec/get_bits.h:236:5: 
      234.     LAST_SKIP_BITS(re, s, n);
      235.     CLOSE_READER(re, s);
      236.     return tmp;
               ^
      237. }
      238. 

libavcodec/get_bits.h:237:1: return from a call to get_bits
      235.     CLOSE_READER(re, s);
      236.     return tmp;
      237. }
           ^
      238. 
      239. /**

libavcodec/get_bits.h:305:1: return from a call to get_bits_long
    303. #endif
    304.     }
    305. }
         ^
    306. 
    307. /**

libavcodec/get_bits.h:326:1: return from a call to show_bits_long
  324.         return get_bits_long(&gb, n);
  325.     }
  326. }
       ^
  327. 
  328. static inline int check_marker(GetBitContext *s, const char *msg)

libavcodec/mlpdec.c:984:9: Taking false branch
982. 
983.     m->is_major_sync_unit = 0;
984.     if (show_bits_long(&gb, 31) == (0xf8726fba >> 1)) {
             ^
985.         if (read_major_sync(m, &gb) < 0)
986.             goto error;

libavcodec/mlpdec.c:991:10: Taking false branch
989.     }
990. 
991.     if (!m->params_valid) {
              ^
992.         av_log(m->avctx, AV_LOG_WARNING,
993.                "Stream parameters not seen; skipping frame.\n");

libavcodec/mlpdec.c:998:5: 
 996.     }
 997. 
 998.     substream_start = 0;
          ^
 999. 
1000.     for (substr = 0; substr < m->num_substreams; substr++) {

libavcodec/mlpdec.c:1000:10: 
 998.     substream_start = 0;
 999. 
1000.     for (substr = 0; substr < m->num_substreams; substr++) {
               ^
1001.         int extraword_present, checkdata_present, end, nonrestart_substr;
1002. 

libavcodec/mlpdec.c:1000:22: Loop condition is true. Entering loop body
 998.     substream_start = 0;
 999. 
1000.     for (substr = 0; substr < m->num_substreams; substr++) {
                           ^
1001.         int extraword_present, checkdata_present, end, nonrestart_substr;
1002. 

libavcodec/mlpdec.c:1003:9: 
1001.         int extraword_present, checkdata_present, end, nonrestart_substr;
1002. 
1003.         extraword_present = get_bits1(&gb);
              ^
1004.         nonrestart_substr = get_bits1(&gb);
1005.         checkdata_present = get_bits1(&gb);

libavcodec/get_bits.h:259:1: start of procedure get_bits1()
  257. }
  258. 
  259. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  260. {
  261.     unsigned int index = s->index;

libavcodec/get_bits.h:261:5: 
  259. static inline unsigned int get_bits1(GetBitContext *s)
  260. {
  261.     unsigned int index = s->index;
           ^
  262.     uint8_t result = s->buffer[index>>3];
  263. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:262:5: 
  260. {
  261.     unsigned int index = s->index;
  262.     uint8_t result = s->buffer[index>>3];
           ^
  263. #ifdef ALT_BITSTREAM_READER_LE
  264.     result >>= index & 7;
