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

libavcodec/alac.c:261:5: Call
259.     int i, ch;
260. 
261.     bitstream_skip(&alac->bc, 4);  /* element instance tag */
         ^
262.     bitstream_skip(&alac->bc, 12); /* unused header bits */
263. 

libavcodec/bitstream.h:247:9: Assignment
  245.         n -= bc->bits_left;
  246.         bc->bits      = 0;
  247.         bc->bits_left = 0;
               ^
  248. 
  249.         if (n >= 64) {

libavcodec/bitstream.h:255:9: Call
  253.             bc->ptr += skip;
  254.         }
  255.         refill_64(bc);
               ^
  256.         if (n)
  257.             skip_remaining(bc, n);

libavcodec/bitstream.h:45:1: Parameter `bc->bits_left`
    43. } BitstreamContext;
    44. 
    45. static inline void refill_64(BitstreamContext *bc)
        ^
    46. {
    47.     if (bc->ptr >= bc->buffer_end)

libavcodec/alac.c:262:5: Call
260. 
261.     bitstream_skip(&alac->bc, 4);  /* element instance tag */
262.     bitstream_skip(&alac->bc, 12); /* unused header bits */
         ^
263. 
264.     /* the number of output samples is stored in the frame */

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] - 12):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 decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,\n                          int channels)\n{\n    ALACContext *alac = avctx->priv_data;\n    int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret;\n    uint32_t output_samples;\n    int i, ch;\n    bitstream_skip(&alac->bc, 4);\n    bitstream_skip(&alac->bc, 12);\n    has_size = bitstream_read_bit(&alac->bc);\n    alac->extra_bits = bitstream_read(&alac->bc, 2) << 3;\n    bps = alac->sample_size - alac->extra_bits + channels - 1;\n    if (bps > 32) {\n        avpriv_report_missing_feature(avctx, "bps %d", bps);\n        return AVERROR_PATCHWELCOME;\n    }\n    is_compressed = !bitstream_read_bit(&alac->bc);\n    if (has_size)\n        output_samples = bitstream_read(&alac->bc, 32);\n    else\n        output_samples = alac->max_samples_per_frame;\n    if (!output_samples || output_samples > alac->max_samples_per_frame) {\n        av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %"PRIu32"\\n",\n               output_samples);\n        return AVERROR_INVALIDDATA;\n    }\n    if (!alac->nb_samples) {\n        frame->nb_samples = output_samples;\n        if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {\n            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\\n");\n            return ret;\n        }\n    } else if (output_samples != alac->nb_samples) {\n        av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %"PRIu32" != %d\\n",\n               output_samples, alac->nb_samples);\n        return AVERROR_INVALIDDATA;\n    }\n    alac->nb_samples = output_samples;\n    if (alac->sample_size > 16) {\n        for (ch = 0; ch < channels; ch++)\n            alac->output_samples_buffer[ch] = (int32_t *)frame->extended_data[ch_index + ch];\n    }\n    if (is_compressed) {\n        int16_t lpc_coefs[2][32];\n        int lpc_order[2];\n        int prediction_type[2];\n        int lpc_quant[2];\n        int rice_history_mult[2];\n        if (!alac->rice_limit) {\n            avpriv_request_sample(alac->avctx,\n                                  "Compression with rice limit 0");\n            return AVERROR(ENOSYS);\n        }\n        decorr_shift       = bitstream_read(&alac->bc, 8);\n        decorr_left_weight = bitstream_read(&alac->bc, 8);\n        for (ch = 0; ch < channels; ch++) {\n            prediction_type[ch]   = bitstream_read(&alac->bc, 4);\n            lpc_quant[ch]         = bitstream_read(&alac->bc, 4);\n            rice_history_mult[ch] = bitstream_read(&alac->bc, 3);\n            lpc_order[ch]         = bitstream_read(&alac->bc, 5);\n            if (lpc_order[ch] >= alac->max_samples_per_frame)\n                return AVERROR_INVALIDDATA;\n            for (i = lpc_order[ch] - 1; i >= 0; i--)\n                lpc_coefs[ch][i] = bitstream_read_signed(&alac->bc, 16);\n        }\n        if (alac->extra_bits) {\n            for (i = 0; i < alac->nb_samples; i++) {\n                for (ch = 0; ch < channels; ch++)\n                    alac->extra_bits_buffer[ch][i] = bitstream_read(&alac->bc, alac->extra_bits);\n            }\n        }\n        for (ch = 0; ch < channels; ch++) {\n            rice_decompress(alac, alac->predict_error_buffer[ch],\n                            alac->nb_samples, bps,\n                            rice_history_mult[ch] * alac->rice_history_mult / 4);\n            if (prediction_type[ch] == 15) {\n                lpc_prediction(alac->predict_error_buffer[ch],\n                               alac->predict_error_buffer[ch],\n                               alac->nb_samples, bps, NULL, 31, 0);\n            } else if (prediction_type[ch] > 0) {\n                av_log(avctx, AV_LOG_WARNING, "unknown prediction type: %i\\n",\n                       prediction_type[ch]);\n            }\n            lpc_prediction(alac->predict_error_buffer[ch],\n                           alac->output_samples_buffer[ch], alac->nb_samples,\n                           bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]);\n        }\n    } else {\n        for (i = 0; i < alac->nb_samples; i++) {\n            for (ch = 0; ch < channels; ch++) {\n                alac->output_samples_buffer[ch][i] =\n                         bitstream_read_signed(&alac->bc, alac->sample_size);\n            }\n        }\n        alac->extra_bits   = 0;\n        decorr_shift       = 0;\n        decorr_left_weight = 0;\n    }\n    if (channels == 2 && decorr_left_weight) {\n        decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,\n                           decorr_shift, decorr_left_weight);\n    }\n    if (alac->extra_bits) {\n        append_extra_bits(alac->output_samples_buffer, alac->extra_bits_buffer,\n                          alac->extra_bits, channels, alac->nb_samples);\n    }\n    switch(alac->sample_size) {\n    case 16: {\n        for (ch = 0; ch < channels; ch++) {\n            int16_t *outbuffer = (int16_t *)frame->extended_data[ch_index + ch];\n            for (i = 0; i < alac->nb_samples; i++)\n                *outbuffer++ = alac->output_samples_buffer[ch][i];\n        }}\n        break;\n    case 24: {\n        for (ch = 0; ch < channels; ch++) {\n            for (i = 0; i < alac->nb_samples; i++)\n                alac->output_samples_buffer[ch][i] <<= 8;\n        }}\n        break;\n    }\n    return 0;\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 refill_64(BitstreamContext *bc)\n{\n    if (bc->ptr >= bc->buffer_end)\n        return;\n#ifdef BITSTREAM_READER_LE\n    bc->bits       = AV_RL64(bc->ptr);\n#else\n    bc->bits       = AV_RB64(bc->ptr);\n#endif\n    bc->ptr       += 8;\n    bc->bits_left  = 64;\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}']