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

libavcodec/takdec.c:688:16: Call
686.     bitstream_init8(bc, pkt->data, pkt->size);
687. 
688.     if ((ret = ff_tak_decode_frame_header(avctx, bc, &s->ti, 0)) < 0)
                    ^
689.         return ret;
690. 

libavcodec/tak.c:127:9: Call
  125.                                TAKStreamInfo *ti, int log_level_offset)
  126. {
  127.     if (bitstream_read(bc, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) {
               ^
  128.         av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n");
  129.         return AVERROR_INVALIDDATA;

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/takdec.c:779:27: Call
777.         if (s->ti.codec == TAK_CODEC_MONO_STEREO) {
778.             for (chan = 0; chan < avctx->channels; chan++)
779.                 if (ret = decode_channel(s, chan))
                               ^
780.                     return ret;
781. 

libavcodec/takdec.c:504:1: Parameter `s->bc.bits_left`
  502. }
  503. 
  504. static int decode_channel(TAKDecContext *s, int chan)
       ^
  505. {
  506.     AVCodecContext *avctx = s->avctx;

libavcodec/takdec.c:513:29: Call
  511.     int subframe_len[MAX_SUBFRAMES];
  512. 
  513.     s->sample_shift[chan] = bits_esc4(bc);
                                   ^
  514.     if (s->sample_shift[chan] >= avctx->bits_per_coded_sample)
  515.         return AVERROR_INVALIDDATA;

libavcodec/takdec.c:367:1: Parameter `bc->bits_left`
    365. }
    366. 
    367. static int bits_esc4(BitstreamContext *bc)
         ^
    368. {
    369.     if (bitstream_read_bit(bc))

libavcodec/takdec.c:369:9: Call
    367. static int bits_esc4(BitstreamContext *bc)
    368. {
    369.     if (bitstream_read_bit(bc))
                 ^
    370.         return bitstream_read(bc, 4) + 1;
    371.     else

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