libavcodec/qdm2.c:918: error: Integer Overflow L2
  ([1, +oo] - 7):unsigned32 by call to `bitstream_read`.

libavcodec/qdm2.c:918:33: Call
916.                     case 24:
917.                         if (bitstream_bits_left(bc) >= 7) {
918.                             n = bitstream_read(bc, 7);
                                     ^
919.                             for (k = 0; k < 3; k++)
920.                                 samples[k] = (random_dequant_type24[n][k] - 2.0) * 0.5;

libavcodec/bitstream.h:183:1: Parameter `n`
  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/bitstream.h:194:12: Call
  192.     }
  193. 
  194.     return get_val(bc, n);
                  ^
  195. }
  196. 

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: ([1, +oo] - 7):unsigned32 by call to `bitstream_read` 
    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 void synthfilt_build_sb_samples(QDM2Context *q, BitstreamContext *bc,\n                                       int length, int sb_min, int sb_max)\n{\n    int sb, j, k, n, ch, run, channels;\n    int joined_stereo, zero_encoding;\n    int type34_first;\n    float type34_div = 0;\n    float type34_predictor;\n    float samples[10], sign_bits[16];\n    if (length == 0) {\n        for (sb=sb_min; sb < sb_max; sb++)\n            build_sb_samples_from_noise(q, sb);\n        return;\n    }\n    for (sb = sb_min; sb < sb_max; sb++) {\n        channels = q->nb_channels;\n        if (q->nb_channels <= 1 || sb < 12)\n            joined_stereo = 0;\n        else if (sb >= 24)\n            joined_stereo = 1;\n        else\n            joined_stereo = (bitstream_bits_left(bc) >= 1) ? bitstream_read_bit(bc) : 0;\n        if (joined_stereo) {\n            if (bitstream_bits_left(bc) >= 16)\n                for (j = 0; j < 16; j++)\n                    sign_bits[j] = bitstream_read_bit(bc);\n            for (j = 0; j < 64; j++)\n                if (q->coding_method[1][sb][j] > q->coding_method[0][sb][j])\n                    q->coding_method[0][sb][j] = q->coding_method[1][sb][j];\n            if (fix_coding_method_array(sb, q->nb_channels,\n                                            q->coding_method)) {\n                build_sb_samples_from_noise(q, sb);\n                continue;\n            }\n            channels = 1;\n        }\n        for (ch = 0; ch < channels; ch++) {\n            FIX_NOISE_IDX(q->noise_idx);\n            zero_encoding = (bitstream_bits_left(bc) >= 1) ? bitstream_read_bit(bc) : 0;\n            type34_predictor = 0.0;\n            type34_first = 1;\n            for (j = 0; j < 128; ) {\n                switch (q->coding_method[ch][sb][j / 2]) {\n                    case 8:\n                        if (bitstream_bits_left(bc) >= 10) {\n                            if (zero_encoding) {\n                                for (k = 0; k < 5; k++) {\n                                    if ((j + 2 * k) >= 128)\n                                        break;\n                                    samples[2 * k] = bitstream_read_bit(bc) ? dequant_1bit[joined_stereo][2 * bitstream_read_bit(bc)] : 0;\n                                }\n                            } else {\n                                n = bitstream_read(bc, 8);\n                                for (k = 0; k < 5; k++)\n                                    samples[2 * k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];\n                            }\n                            for (k = 0; k < 5; k++)\n                                samples[2 * k + 1] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        } else {\n                            for (k = 0; k < 10; k++)\n                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        }\n                        run = 10;\n                        break;\n                    case 10:\n                        if (bitstream_bits_left(bc) >= 1) {\n                            float f = 0.81;\n                            if (bitstream_read_bit(bc))\n                                f = -f;\n                            f -= noise_samples[((sb + 1) * (j +5 * ch + 1)) & 127] * 9.0 / 40.0;\n                            samples[0] = f;\n                        } else {\n                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        }\n                        run = 1;\n                        break;\n                    case 16:\n                        if (bitstream_bits_left(bc) >= 10) {\n                            if (zero_encoding) {\n                                for (k = 0; k < 5; k++) {\n                                    if ((j + k) >= 128)\n                                        break;\n                                    samples[k] = (bitstream_read_bit(bc) == 0) ? 0 : dequant_1bit[joined_stereo][2 * bitstream_read_bit(bc)];\n                                }\n                            } else {\n                                n = bitstream_read (bc, 8);\n                                for (k = 0; k < 5; k++)\n                                    samples[k] = dequant_1bit[joined_stereo][random_dequant_index[n][k]];\n                            }\n                        } else {\n                            for (k = 0; k < 5; k++)\n                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        }\n                        run = 5;\n                        break;\n                    case 24:\n                        if (bitstream_bits_left(bc) >= 7) {\n                            n = bitstream_read(bc, 7);\n                            for (k = 0; k < 3; k++)\n                                samples[k] = (random_dequant_type24[n][k] - 2.0) * 0.5;\n                        } else {\n                            for (k = 0; k < 3; k++)\n                                samples[k] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        }\n                        run = 3;\n                        break;\n                    case 30:\n                        if (bitstream_bits_left(bc) >= 4) {\n                            unsigned index = qdm2_get_vlc(bc, &vlc_tab_type30, 0, 1);\n                            if (index < FF_ARRAY_ELEMS(type30_dequant)) {\n                                samples[0] = type30_dequant[index];\n                            } else\n                                samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        } else\n                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        run = 1;\n                        break;\n                    case 34:\n                        if (bitstream_bits_left(bc) >= 7) {\n                            if (type34_first) {\n                                type34_div = (float)(1 << bitstream_read(bc, 2));\n                                samples[0] = ((float)bitstream_read(bc, 5) - 16.0) / 15.0;\n                                type34_predictor = samples[0];\n                                type34_first = 0;\n                            } else {\n                                unsigned index = qdm2_get_vlc(bc, &vlc_tab_type34, 0, 1);\n                                if (index < FF_ARRAY_ELEMS(type34_delta)) {\n                                    samples[0] = type34_delta[index] / type34_div + type34_predictor;\n                                    type34_predictor = samples[0];\n                                } else\n                                    samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                            }\n                        } else {\n                            samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        }\n                        run = 1;\n                        break;\n                    default:\n                        samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);\n                        run = 1;\n                        break;\n                }\n                if (joined_stereo) {\n                    for (k = 0; k < run && j + k < 128; k++) {\n                        q->sb_samples[0][j + k][sb] =\n                            q->tone_level[0][sb][(j + k) / 2] * samples[k];\n                        if (q->nb_channels == 2) {\n                            if (sign_bits[(j + k) / 8])\n                                q->sb_samples[1][j + k][sb] =\n                                    q->tone_level[1][sb][(j + k) / 2] * -samples[k];\n                            else\n                                q->sb_samples[1][j + k][sb] =\n                                    q->tone_level[1][sb][(j + k) / 2] * samples[k];\n                        }\n                    }\n                } else {\n                    for (k = 0; k < run; k++)\n                        if ((j + k) < 128)\n                            q->sb_samples[ch][j + k][sb] = q->tone_level[ch][sb][(j + k)/2] * samples[k];\n                }\n                j += run;\n            }\n        }\n    }\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 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}']