libavcodec/atrac3plus.c:741: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `get_num_ct_values`.

libavcodec/atrac3plus.c:738:13: Call
736.     chan->table_type = bitstream_read_bit(bc);
737. 
738.     switch (bitstream_read(bc, 2)) { /* switch according to coding mode */
                 ^
739.     case 0: /* directly coded */
740.         num_bits = ctx->use_full_table + 2;

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

libavcodec/atrac3plus.c:741:9: Call
739.     case 0: /* directly coded */
740.         num_bits = ctx->use_full_table + 2;
741.         DEC_CT_IDX_COMMON(CODING_DIRECT);
             ^
742.         break;
743.     case 1: /* entropy-coded */

libavcodec/atrac3plus.c:674:1: Parameter `bc->bits_left`
  672.  * @return result code: 0 = OK, otherwise - error code
  673.  */
  674. static int get_num_ct_values(BitstreamContext *bc, Atrac3pChanUnitCtx *ctx,
       ^
  675.                              AVCodecContext *avctx)
  676. {

libavcodec/atrac3plus.c:679:9: Call
  677.     int num_coded_vals;
  678. 
  679.     if (bitstream_read_bit(bc)) {
               ^
  680.         num_coded_vals = bitstream_read(bc, 5);
  681.         if (num_coded_vals > ctx->used_quant_units) {

libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
    143. 
    144. /* Return one bit from the buffer. */
    145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
         ^
    146. {
    147.     if (!bc->bits_left)

libavcodec/bitstream.h:150:12: Call
    148.         refill_64(bc);
    149. 
    150.     return get_val(bc, 1);
                    ^
    151. }
    152. 

libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
      128. }
      129. 
      130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
           ^
      131. {
      132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129. 
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
     ^
131. {
132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:130:1: Parameter `n`
      128. }
      129. 
      130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
           ^
      131. {
      132. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `get_num_ct_values` 
      137.     bc->bits <<= n;
      138. #endif
      139.     bc->bits_left -= n;
               ^
      140. 
      141.     return ret;

static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
    bc->bits >>= n;
#else
    uint64_t ret = bc->bits >> (64 - n);
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
    return ret;
}
['static int decode_channel_code_tab(BitstreamContext *bc, Atrac3pChanUnitCtx *ctx,\n                                   int ch_num, AVCodecContext *avctx)\n{\n    int i, num_vals, num_bits, pred;\n    int mask = ctx->use_full_table ? 7 : 3;\n    VLC *vlc_tab, *delta_vlc;\n    Atrac3pChanParams *chan     = &ctx->channels[ch_num];\n    Atrac3pChanParams *ref_chan = &ctx->channels[0];\n    chan->table_type = bitstream_read_bit(bc);\n    switch (bitstream_read(bc, 2)) {\n    case 0:\n        num_bits = ctx->use_full_table + 2;\n        DEC_CT_IDX_COMMON(CODING_DIRECT);\n        break;\n    case 1:\n        vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[1]\n                                      : ct_vlc_tabs;\n        DEC_CT_IDX_COMMON(CODING_VLC);\n        break;\n    case 2:\n        if (ctx->use_full_table) {\n            vlc_tab   = &ct_vlc_tabs[1];\n            delta_vlc = &ct_vlc_tabs[2];\n        } else {\n            vlc_tab   = ct_vlc_tabs;\n            delta_vlc = ct_vlc_tabs;\n        }\n        pred = 0;\n        DEC_CT_IDX_COMMON(CODING_VLC_DELTA);\n        break;\n    case 3:\n        if (ch_num) {\n            vlc_tab = ctx->use_full_table ? &ct_vlc_tabs[3]\n                                          : ct_vlc_tabs;\n            DEC_CT_IDX_COMMON(CODING_VLC_DIFF);\n        }\n        break;\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 int get_num_ct_values(BitstreamContext *bc, Atrac3pChanUnitCtx *ctx,\n                             AVCodecContext *avctx)\n{\n    int num_coded_vals;\n    if (bitstream_read_bit(bc)) {\n        num_coded_vals = bitstream_read(bc, 5);\n        if (num_coded_vals > ctx->used_quant_units) {\n            av_log(avctx, AV_LOG_ERROR,\n                   "Invalid number of code table indexes: %d!\\n", num_coded_vals);\n            return AVERROR_INVALIDDATA;\n        }\n        return num_coded_vals;\n    } else\n        return ctx->used_quant_units;\n}', 'static inline unsigned bitstream_read_bit(BitstreamContext *bc)\n{\n    if (!bc->bits_left)\n        refill_64(bc);\n    return get_val(bc, 1);\n}', 'static inline uint64_t get_val(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);\n    bc->bits >>= n;\n#else\n    uint64_t ret = bc->bits >> (64 - n);\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n    return ret;\n}']