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

libavcodec/atrac3plus.c:1745:9: Call
1743.         decode_tones_frequency(bc, ctx, ch_num, band_has_tones);
1744.         decode_tones_amplitude(bc, ctx, ch_num, band_has_tones);
1745.         decode_tones_phase(bc, ctx, ch_num, band_has_tones);
              ^
1746.     }
1747. 

libavcodec/atrac3plus.c:1671:1: Parameter `bc->bits_left`
  1669.  *                                  1 - tone data present
  1670.  */
  1671. static void decode_tones_phase(BitstreamContext *bc, Atrac3pChanUnitCtx *ctx,
        ^
  1672.                                int ch_num, int band_has_tones[])
  1673. {

libavcodec/atrac3plus.c:1738:9: Call
1736.             band_has_tones[i] = !ch_num ? 1 : !ctx->waves_info->tone_sharing[i];
1737. 
1738.         decode_tones_envelope(bc, ctx, ch_num, band_has_tones);
              ^
1739.         if ((ret = decode_band_numwavs(bc, ctx, ch_num, band_has_tones,
1740.                                        avctx)) < 0)

libavcodec/atrac3plus.c:1406:1: Parameter `bc->bits_left`
  1404.  *                                  1 - tone data present
  1405.  */
  1406. static void decode_tones_envelope(BitstreamContext *bc, Atrac3pChanUnitCtx *ctx,
        ^
  1407.                                   int ch_num, int band_has_tones[])
  1408. {

libavcodec/atrac3plus.c:1413:21: Call
  1411.     Atrac3pWavesData *ref = ctx->channels[0].tones_info;
  1412. 
  1413.     if (!ch_num || !bitstream_read_bit(bc)) { /* mode 0: fixed-length coding */
                            ^
  1414.         for (sb = 0; sb < ctx->waves_info->num_tone_bands; sb++) {
  1415.             if (!band_has_tones[sb])

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 `decode_tones_envelope` 
      137.     bc->bits <<= n;
      138. #endif
      139.     bc->bits_left -= n;
               ^
      140. 
      141.     return ret;
