libavcodec/cook.c:344: error: Integer Overflow L2
  ([0, +oo] - 7):unsigned32.

libavcodec/cook.c:344:45: <LHS trace>
342.     while (n--) {
343.         int index = bitstream_read(bc, 3);
344.         int gain = bitstream_read_bit(bc) ? bitstream_read(bc, 4) - 7 : -1;
                                                 ^
345. 
346.         while (i <= index)

libavcodec/cook.c:344:45: Call
342.     while (n--) {
343.         int index = bitstream_read(bc, 3);
344.         int gain = bitstream_read_bit(bc) ? bitstream_read(bc, 4) - 7 : -1;
                                                 ^
345. 
346.         while (i <= index)

libavcodec/bitstream.h:186:9: Assignment
  184. {
  185.     if (!n)
  186.         return 0;
               ^
  187. 
  188.     if (n > bc->bits_left) {

libavcodec/cook.c:344:20: Binary operation: ([0, +oo] - 7):unsigned32
342.     while (n--) {
343.         int index = bitstream_read(bc, 3);
344.         int gain = bitstream_read_bit(bc) ? bitstream_read(bc, 4) - 7 : -1;
                        ^
345. 
346.         while (i <= index)

static void decode_gain_info(BitstreamContext *bc, int *gaininfo)
{
    int i, n;
    while (bitstream_read_bit(bc)) {
    }
    n = bitstream_tell(bc) - 1;
    i = 0;
    while (n--) {
        int index = bitstream_read(bc, 3);
        int gain = bitstream_read_bit(bc) ? bitstream_read(bc, 4) - 7 : -1;
        while (i <= index)
            gaininfo[i++] = gain;
    }
    while (i <= 8)
        gaininfo[i++] = 0;
}
['static void decode_gain_info(BitstreamContext *bc, int *gaininfo)\n{\n    int i, n;\n    while (bitstream_read_bit(bc)) {\n    }\n    n = bitstream_tell(bc) - 1;\n    i = 0;\n    while (n--) {\n        int index = bitstream_read(bc, 3);\n        int gain = bitstream_read_bit(bc) ? bitstream_read(bc, 4) - 7 : -1;\n        while (i <= index)\n            gaininfo[i++] = gain;\n    }\n    while (i <= 8)\n        gaininfo[i++] = 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}']