libavcodec/bink.c:636: error: Integer Overflow L2
  (1 - [0, 2]):unsigned32.

libavcodec/bink.c:636:38: <RHS trace>
634.                     } else {
635.                         if (!bits) {
636.                             t = 1 - (get_bits1(gb) << 1);
                                          ^
637.                         } else {
638.                             t = get_bits(gb, bits) | 1 << bits;

libavcodec/bink.c:636:38: Call
634.                     } else {
635.                         if (!bits) {
636.                             t = 1 - (get_bits1(gb) << 1);
                                          ^
637.                         } else {
638.                             t = get_bits(gb, bits) | 1 << bits;

libavcodec/get_bits.h:255:1: Parameter `s->index`
  253. }
  254. 
  255. static inline unsigned int get_bits1(GetBitContext *s)
       ^
  256. {
  257.     unsigned int index = s->index;

libavcodec/get_bits.h:257:5: Assignment
  255. static inline unsigned int get_bits1(GetBitContext *s)
  256. {
  257.     unsigned int index = s->index;
           ^
  258.     uint8_t result = s->buffer[index>>3];
  259. #ifdef BITSTREAM_READER_LE

libavcodec/get_bits.h:260:5: Assignment
  258.     uint8_t result = s->buffer[index>>3];
  259. #ifdef BITSTREAM_READER_LE
  260.     result >>= index & 7;
           ^
  261.     result &= 1;
  262. #else

libavcodec/get_bits.h:261:5: Assignment
  259. #ifdef BITSTREAM_READER_LE
  260.     result >>= index & 7;
  261.     result &= 1;
           ^
  262. #else
  263.     result <<= index & 7;

libavcodec/get_bits.h:272:5: Assignment
  270.     s->index = index;
  271. 
  272.     return result;
           ^
  273. }
  274. 

libavcodec/bink.c:636:29: Binary operation: (1 - [0, 2]):unsigned32
634.                     } else {
635.                         if (!bits) {
636.                             t = 1 - (get_bits1(gb) << 1);
                                 ^
637.                         } else {
638.                             t = get_bits(gb, bits) | 1 << bits;

static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *scan,
                           const int32_t quant_matrices[16][64], int q)
{
    int coef_list[128];
    int mode_list[128];
    int i, t, bits, ccoef, mode, sign;
    int list_start = 64, list_end = 64, list_pos;
    int coef_count = 0;
    int coef_idx[64];
    int quant_idx;
    const int32_t *quant;
    coef_list[list_end] = 4;  mode_list[list_end++] = 0;
    coef_list[list_end] = 24; mode_list[list_end++] = 0;
    coef_list[list_end] = 44; mode_list[list_end++] = 0;
    coef_list[list_end] = 1;  mode_list[list_end++] = 3;
    coef_list[list_end] = 2;  mode_list[list_end++] = 3;
    coef_list[list_end] = 3;  mode_list[list_end++] = 3;
    for (bits = get_bits(gb, 4) - 1; bits >= 0; bits--) {
        list_pos = list_start;
        while (list_pos < list_end) {
            if (!(mode_list[list_pos] | coef_list[list_pos]) || !get_bits1(gb)) {
                list_pos++;
                continue;
            }
            ccoef = coef_list[list_pos];
            mode  = mode_list[list_pos];
            switch (mode) {
            case 0:
                coef_list[list_pos] = ccoef + 4;
                mode_list[list_pos] = 1;
            case 2:
                if (mode == 2) {
                    coef_list[list_pos]   = 0;
                    mode_list[list_pos++] = 0;
                }
                for (i = 0; i < 4; i++, ccoef++) {
                    if (get_bits1(gb)) {
                        coef_list[--list_start] = ccoef;
                        mode_list[  list_start] = 3;
                    } else {
                        if (!bits) {
                            t = 1 - (get_bits1(gb) << 1);
                        } else {
                            t = get_bits(gb, bits) | 1 << bits;
                            sign = -get_bits1(gb);
                            t = (t ^ sign) - sign;
                        }
                        block[scan[ccoef]] = t;
                        coef_idx[coef_count++] = ccoef;
                    }
                }
                break;
            case 1:
                mode_list[list_pos] = 2;
                for (i = 0; i < 3; i++) {
                    ccoef += 4;
                    coef_list[list_end]   = ccoef;
                    mode_list[list_end++] = 2;
                }
                break;
            case 3:
                if (!bits) {
                    t = 1 - (get_bits1(gb) << 1);
                } else {
                    t = get_bits(gb, bits) | 1 << bits;
                    sign = -get_bits1(gb);
                    t = (t ^ sign) - sign;
                }
                block[scan[ccoef]] = t;
                coef_idx[coef_count++] = ccoef;
                coef_list[list_pos]   = 0;
                mode_list[list_pos++] = 0;
                break;
            }
        }
    }
    if (q == -1) {
        quant_idx = get_bits(gb, 4);
    } else {
        quant_idx = q;
    }
    quant = quant_matrices[quant_idx];
    block[0] = (block[0] * quant[0]) >> 11;
    for (i = 0; i < coef_count; i++) {
        int idx = coef_idx[i];
        block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
    }
    return 0;
}
['static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *scan,\n                           const int32_t quant_matrices[16][64], int q)\n{\n    int coef_list[128];\n    int mode_list[128];\n    int i, t, bits, ccoef, mode, sign;\n    int list_start = 64, list_end = 64, list_pos;\n    int coef_count = 0;\n    int coef_idx[64];\n    int quant_idx;\n    const int32_t *quant;\n    coef_list[list_end] = 4;  mode_list[list_end++] = 0;\n    coef_list[list_end] = 24; mode_list[list_end++] = 0;\n    coef_list[list_end] = 44; mode_list[list_end++] = 0;\n    coef_list[list_end] = 1;  mode_list[list_end++] = 3;\n    coef_list[list_end] = 2;  mode_list[list_end++] = 3;\n    coef_list[list_end] = 3;  mode_list[list_end++] = 3;\n    for (bits = get_bits(gb, 4) - 1; bits >= 0; bits--) {\n        list_pos = list_start;\n        while (list_pos < list_end) {\n            if (!(mode_list[list_pos] | coef_list[list_pos]) || !get_bits1(gb)) {\n                list_pos++;\n                continue;\n            }\n            ccoef = coef_list[list_pos];\n            mode  = mode_list[list_pos];\n            switch (mode) {\n            case 0:\n                coef_list[list_pos] = ccoef + 4;\n                mode_list[list_pos] = 1;\n            case 2:\n                if (mode == 2) {\n                    coef_list[list_pos]   = 0;\n                    mode_list[list_pos++] = 0;\n                }\n                for (i = 0; i < 4; i++, ccoef++) {\n                    if (get_bits1(gb)) {\n                        coef_list[--list_start] = ccoef;\n                        mode_list[  list_start] = 3;\n                    } else {\n                        if (!bits) {\n                            t = 1 - (get_bits1(gb) << 1);\n                        } else {\n                            t = get_bits(gb, bits) | 1 << bits;\n                            sign = -get_bits1(gb);\n                            t = (t ^ sign) - sign;\n                        }\n                        block[scan[ccoef]] = t;\n                        coef_idx[coef_count++] = ccoef;\n                    }\n                }\n                break;\n            case 1:\n                mode_list[list_pos] = 2;\n                for (i = 0; i < 3; i++) {\n                    ccoef += 4;\n                    coef_list[list_end]   = ccoef;\n                    mode_list[list_end++] = 2;\n                }\n                break;\n            case 3:\n                if (!bits) {\n                    t = 1 - (get_bits1(gb) << 1);\n                } else {\n                    t = get_bits(gb, bits) | 1 << bits;\n                    sign = -get_bits1(gb);\n                    t = (t ^ sign) - sign;\n                }\n                block[scan[ccoef]] = t;\n                coef_idx[coef_count++] = ccoef;\n                coef_list[list_pos]   = 0;\n                mode_list[list_pos++] = 0;\n                break;\n            }\n        }\n    }\n    if (q == -1) {\n        quant_idx = get_bits(gb, 4);\n    } else {\n        quant_idx = q;\n    }\n    quant = quant_matrices[quant_idx];\n    block[0] = (block[0] * quant[0]) >> 11;\n    for (i = 0; i < coef_count; i++) {\n        int idx = coef_idx[i];\n        block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;\n    }\n    return 0;\n}', 'static inline unsigned int get_bits1(GetBitContext *s)\n{\n    unsigned int index = s->index;\n    uint8_t result = s->buffer[index>>3];\n#ifdef BITSTREAM_READER_LE\n    result >>= index & 7;\n    result &= 1;\n#else\n    result <<= index & 7;\n    result >>= 8 - 1;\n#endif\n#if !UNCHECKED_BITSTREAM_READER\n    if (s->index < s->size_in_bits_plus8)\n#endif\n        index++;\n    s->index = index;\n    return result;\n}']