libavcodec/mlpdec.c:532: error: Integer Overflow L2
  ([0, +oo] - 19):unsigned32 by call to `bitstream_skip`.

libavcodec/mlpdec.c:530:24: Call
528. 
529.     s->noise_shift   = bitstream_read(bc,  4);
530.     s->noisegen_seed = bitstream_read(bc, 23);
                            ^
531. 
532.     bitstream_skip(bc, 19);

libavcodec/bitstream.h:182:1: Parameter `bc->bits_left`
  180. 
  181. /* Return n bits from the buffer. n has to be in the 0-32 range. */
  182. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
       ^
  183. {
  184.     if (!n)

libavcodec/mlpdec.c:532:5: Call
530.     s->noisegen_seed = bitstream_read(bc, 23);
531. 
532.     bitstream_skip(bc, 19);
         ^
533. 
534.     s->data_check_present = bitstream_read_bit(bc);

libavcodec/bitstream.h:240:1: Parameter `n`
  238. 
  239. /* Skip n bits in the buffer. */
  240. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
       ^
  241. {
  242.     if (n < bc->bits_left)

libavcodec/bitstream.h:243:9: Call
  241. {
  242.     if (n < bc->bits_left)
  243.         skip_remaining(bc, n);
               ^
  244.     else {
  245.         n -= bc->bits_left;

libavcodec/bitstream.h:229:1: <LHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `bc->bits_left`
    227. }
    228. 
    229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
         ^
    230. {
    231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: <RHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `n`
    227. }
    228. 
    229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
         ^
    230. {
    231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:236:5: Binary operation: ([0, +oo] - 19):unsigned32 by call to `bitstream_skip` 
    234.     bc->bits <<= n;
    235. #endif
    236.     bc->bits_left -= n;
             ^
    237. }
    238. 

static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    bc->bits >>= n;
#else
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
}
['static int read_restart_header(MLPDecodeContext *m, BitstreamContext *bc,\n                               const uint8_t *buf, unsigned int substr)\n{\n    SubStream *s = &m->substream[substr];\n    unsigned int ch;\n    int sync_word, tmp;\n    uint8_t checksum;\n    uint8_t lossless_check;\n    int start_count = bitstream_tell(bc);\n    int min_channel, max_channel, max_matrix_channel;\n    const int std_max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP\n                                     ? MAX_MATRIX_CHANNEL_MLP\n                                     : MAX_MATRIX_CHANNEL_TRUEHD;\n    sync_word = bitstream_read(bc, 13);\n    if (sync_word != 0x31ea >> 1) {\n        av_log(m->avctx, AV_LOG_ERROR,\n               "restart header sync incorrect (got 0x%04x)\\n", sync_word);\n        return AVERROR_INVALIDDATA;\n    }\n    s->noise_type = bitstream_read_bit(bc);\n    if (m->avctx->codec_id == AV_CODEC_ID_MLP && s->noise_type) {\n        av_log(m->avctx, AV_LOG_ERROR, "MLP must have 0x31ea sync word.\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    bitstream_skip(bc, 16);\n    min_channel        = bitstream_read(bc, 4);\n    max_channel        = bitstream_read(bc, 4);\n    max_matrix_channel = bitstream_read(bc, 4);\n    if (max_matrix_channel > std_max_matrix_channel) {\n        av_log(m->avctx, AV_LOG_ERROR,\n               "Max matrix channel cannot be greater than %d.\\n",\n               max_matrix_channel);\n        return AVERROR_INVALIDDATA;\n    }\n    if (max_channel != max_matrix_channel) {\n        av_log(m->avctx, AV_LOG_ERROR,\n               "Max channel must be equal max matrix channel.\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    if (s->max_channel > MAX_MATRIX_CHANNEL_MLP && !s->noise_type) {\n        avpriv_request_sample(m->avctx,\n                              "%d channels (more than the "\n                              "maximum supported by the decoder)",\n                              s->max_channel + 2);\n        return AVERROR_PATCHWELCOME;\n    }\n    if (min_channel > max_channel) {\n        av_log(m->avctx, AV_LOG_ERROR,\n               "Substream min channel cannot be greater than max channel.\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    s->min_channel        = min_channel;\n    s->max_channel        = max_channel;\n    s->max_matrix_channel = max_matrix_channel;\n    if (mlp_channel_layout_subset(m->avctx->request_channel_layout, s->mask) &&\n        m->max_decoded_substream > substr) {\n        av_log(m->avctx, AV_LOG_DEBUG,\n               "Extracting %d-channel downmix (0x%"PRIx64") from substream %d. "\n               "Further substreams will be skipped.\\n",\n               s->max_channel + 1, s->mask, substr);\n        m->max_decoded_substream = substr;\n    }\n    s->noise_shift   = bitstream_read(bc,  4);\n    s->noisegen_seed = bitstream_read(bc, 23);\n    bitstream_skip(bc, 19);\n    s->data_check_present = bitstream_read_bit(bc);\n    lossless_check = bitstream_read(bc, 8);\n    if (substr == m->max_decoded_substream\n        && s->lossless_check_data != 0xffffffff) {\n        tmp = xor_32_to_8(s->lossless_check_data);\n        if (tmp != lossless_check)\n            av_log(m->avctx, AV_LOG_WARNING,\n                   "Lossless check failed - expected %02x, calculated %02x.\\n",\n                   lossless_check, tmp);\n    }\n    bitstream_skip(bc, 16);\n    memset(s->ch_assign, 0, sizeof(s->ch_assign));\n    for (ch = 0; ch <= s->max_matrix_channel; ch++) {\n        int ch_assign = bitstream_read(bc, 6);\n        if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {\n            uint64_t channel = thd_channel_layout_extract_channel(s->mask,\n                                                                  ch_assign);\n            ch_assign = av_get_channel_layout_channel_index(s->mask,\n                                                            channel);\n        }\n        if (ch_assign < 0 || ch_assign > s->max_matrix_channel) {\n            avpriv_request_sample(m->avctx,\n                                  "Assignment of matrix channel %d to invalid output channel %d",\n                                  ch, ch_assign);\n            return AVERROR_PATCHWELCOME;\n        }\n        s->ch_assign[ch_assign] = ch;\n    }\n    checksum = ff_mlp_restart_checksum(buf, bitstream_tell(bc) - start_count);\n    if (checksum != bitstream_read(bc, 8))\n        av_log(m->avctx, AV_LOG_ERROR, "restart header checksum error\\n");\n    s->param_presence_flags   = 0xff;\n    s->num_primitive_matrices = 0;\n    s->blocksize              = 8;\n    s->lossless_check_data    = 0;\n    memset(s->output_shift   , 0, sizeof(s->output_shift   ));\n    memset(s->quant_step_size, 0, sizeof(s->quant_step_size));\n    for (ch = s->min_channel; ch <= s->max_channel; ch++) {\n        ChannelParams *cp = &s->channel_params[ch];\n        cp->filter_params[FIR].order = 0;\n        cp->filter_params[IIR].order = 0;\n        cp->filter_params[FIR].shift = 0;\n        cp->filter_params[IIR].shift = 0;\n        cp->huff_offset      = 0;\n        cp->sign_huff_offset = -(1 << 23);\n        cp->codebook         = 0;\n        cp->huff_lsbs        = 24;\n    }\n    if (substr == m->max_decoded_substream) {\n        m->avctx->channels       = s->max_matrix_channel + 1;\n        m->avctx->channel_layout = s->mask;\n        m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(s->ch_assign,\n                                                               s->output_shift,\n                                                               s->max_matrix_channel,\n                                                               m->avctx->sample_fmt == AV_SAMPLE_FMT_S32);\n    }\n    return 0;\n}', 'static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)\n{\n    if (!n)\n        return 0;\n    if (n > bc->bits_left) {\n        refill_32(bc);\n        if (bc->bits_left < 32)\n            bc->bits_left = n;\n    }\n    return get_val(bc, n);\n}', 'static inline void bitstream_skip(BitstreamContext *bc, unsigned n)\n{\n    if (n < bc->bits_left)\n        skip_remaining(bc, n);\n    else {\n        n -= bc->bits_left;\n        bc->bits      = 0;\n        bc->bits_left = 0;\n        if (n >= 64) {\n            unsigned skip = n / 8;\n            n -= skip * 8;\n            bc->ptr += skip;\n        }\n        refill_64(bc);\n        if (n)\n            skip_remaining(bc, n);\n    }\n}', 'static inline void skip_remaining(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    bc->bits >>= n;\n#else\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n}']