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

libavcodec/bink.c:628:38: <RHS trace>
626.                     } else {
627.                         if (!bits) {
628.                             t = 1 - (get_bits1(gb) << 1);
                                          ^
629.                         } else {
630.                             t = get_bits(gb, bits) | mask;

libavcodec/bink.c:628:38: Call
626.                     } else {
627.                         if (!bits) {
628.                             t = 1 - (get_bits1(gb) << 1);
                                          ^
629.                         } else {
630.                             t = get_bits(gb, bits) | mask;

libavcodec/get_bits.h:303:1: Parameter `s->index`
  301. }
  302. 
  303. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: Assignment
  303. static inline unsigned int get_bits1(GetBitContext *s){
  304. #ifdef ALT_BITSTREAM_READER
  305.     unsigned int index = s->index;
           ^
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:308:5: Assignment
  306.     uint8_t result = s->buffer[index>>3];
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
           ^
  309.     result &= 1;
  310. #else

libavcodec/get_bits.h:309:5: Assignment
  307. #ifdef ALT_BITSTREAM_READER_LE
  308.     result >>= index & 7;
  309.     result &= 1;
           ^
  310. #else
  311.     result <<= index & 7;

libavcodec/get_bits.h:317:5: Assignment
  315.     s->index = index;
  316. 
  317.     return result;
           ^
  318. #else
  319.     return get_bits(s, 1);

libavcodec/bink.c:628:29: Binary operation: (1 - [0, 2]):unsigned32
626.                     } else {
627.                         if (!bits) {
628.                             t = 1 - (get_bits1(gb) << 1);
                                 ^
629.                         } else {
630.                             t = get_bits(gb, bits) | mask;

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, mask, 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;
    bits = get_bits(gb, 4) - 1;
    for (mask = 1 << bits; bits >= 0; mask >>= 1, 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) | mask;
                            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) | mask;
                    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, mask, 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    bits = get_bits(gb, 4) - 1;\n    for (mask = 1 << bits; bits >= 0; mask >>= 1, 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) | mask;\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) | mask;\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#ifdef ALT_BITSTREAM_READER\n    unsigned int index = s->index;\n    uint8_t result = s->buffer[index>>3];\n#ifdef ALT_BITSTREAM_READER_LE\n    result >>= index & 7;\n    result &= 1;\n#else\n    result <<= index & 7;\n    result >>= 8 - 1;\n#endif\n    index++;\n    s->index = index;\n    return result;\n#else\n    return get_bits(s, 1);\n#endif\n}']