libavcodec/bink.c:1215: error: Integer Overflow L2
  ([0, +oo] - 32):unsigned32 by call to `bitstream_skip`.

libavcodec/bink.c:1207:5: Call
1205.     }
1206. 
1207.     bitstream_init(&bc, pkt->data, bits_count);
          ^
1208.     if (c->has_alpha) {
1209.         if (c->version >= 'i')

libavcodec/bitstream.h:84:9: Assignment
  82.         bc->buffer    =
  83.         bc->ptr       = NULL;
  84.         bc->bits_left = 0;
              ^
  85.         return AVERROR_INVALIDDATA;
  86.     }

libavcodec/bink.c:1215:9: Call
1213.     }
1214.     if (c->version >= 'i')
1215.         bitstream_skip(&bc, 32);
              ^
1216. 
1217.     for (plane = 0; plane < 3; plane++) {

libavcodec/bitstream.h:240:1: Parameter `n`
  238. 
  239. /* Skip n bits in the buffer. */
  240. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
       ^
  241. {
  242.     if (n < bc->bits_left)

libavcodec/bitstream.h:243:9: Call
  241. {
  242.     if (n < bc->bits_left)
  243.         skip_remaining(bc, n);
               ^
  244.     else {
  245.         n -= bc->bits_left;

libavcodec/bitstream.h:229:1: <LHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `bc->bits_left`
    227. }
    228. 
    229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
         ^
    230. {
    231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: <RHS trace>
227. }
228. 
229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
     ^
230. {
231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:229:1: Parameter `n`
    227. }
    228. 
    229. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
         ^
    230. {
    231. #ifdef BITSTREAM_READER_LE

libavcodec/bitstream.h:236:5: Binary operation: ([0, +oo] - 32):unsigned32 by call to `bitstream_skip` 
    234.     bc->bits <<= n;
    235. #endif
    236.     bc->bits_left -= n;
             ^
    237. }
    238. 

static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
    bc->bits >>= n;
#else
    bc->bits <<= n;
#endif
    bc->bits_left -= n;
}
['static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)\n{\n    BinkContext * const c = avctx->priv_data;\n    AVFrame *frame = data;\n    BitstreamContext bc;\n    int plane, plane_idx, ret;\n    int bits_count = pkt->size << 3;\n    if (c->version > \'b\') {\n        if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) {\n            av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\\n");\n            return ret;\n        }\n    } else {\n        if ((ret = ff_reget_buffer(avctx, c->last)) < 0) {\n            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\\n");\n            return ret;\n        }\n        if ((ret = av_frame_ref(frame, c->last)) < 0)\n            return ret;\n    }\n    bitstream_init(&bc, pkt->data, bits_count);\n    if (c->has_alpha) {\n        if (c->version >= \'i\')\n            bitstream_skip(&bc, 32);\n        if ((ret = bink_decode_plane(c, frame, &bc, 3, 0)) < 0)\n            return ret;\n    }\n    if (c->version >= \'i\')\n        bitstream_skip(&bc, 32);\n    for (plane = 0; plane < 3; plane++) {\n        plane_idx = (!plane || !c->swap_planes) ? plane : (plane ^ 3);\n        if (c->version > \'b\') {\n            if ((ret = bink_decode_plane(c, frame, &bc, plane_idx, !!plane)) < 0)\n                return ret;\n        } else {\n            if ((ret = binkb_decode_plane(c, frame, &bc, plane_idx,\n                                          !avctx->frame_number, !!plane)) < 0)\n                return ret;\n        }\n        if (bitstream_tell(&bc) >= bits_count)\n            break;\n    }\n    emms_c();\n    if (c->version > \'b\') {\n        av_frame_unref(c->last);\n        if ((ret = av_frame_ref(c->last, frame)) < 0)\n            return ret;\n    }\n    *got_frame = 1;\n    return pkt->size;\n}', 'static inline int bitstream_init(BitstreamContext *bc, const uint8_t *buffer,\n                                 unsigned bit_size)\n{\n    unsigned buffer_size;\n    if (bit_size > INT_MAX - 7 || !buffer) {\n        buffer        =\n        bc->buffer    =\n        bc->ptr       = NULL;\n        bc->bits_left = 0;\n        return AVERROR_INVALIDDATA;\n    }\n    buffer_size = (bit_size + 7) >> 3;\n    bc->buffer       = buffer;\n    bc->buffer_end   = buffer + buffer_size;\n    bc->ptr          = bc->buffer;\n    bc->size_in_bits = bit_size;\n    bc->bits_left    = 0;\n    bc->bits         = 0;\n    refill_64(bc);\n    return 0;\n}', 'static inline void bitstream_skip(BitstreamContext *bc, unsigned n)\n{\n    if (n < bc->bits_left)\n        skip_remaining(bc, n);\n    else {\n        n -= bc->bits_left;\n        bc->bits      = 0;\n        bc->bits_left = 0;\n        if (n >= 64) {\n            unsigned skip = n / 8;\n            n -= skip * 8;\n            bc->ptr += skip;\n        }\n        refill_64(bc);\n        if (n)\n            skip_remaining(bc, n);\n    }\n}', 'static inline void skip_remaining(BitstreamContext *bc, unsigned n)\n{\n#ifdef BITSTREAM_READER_LE\n    bc->bits >>= n;\n#else\n    bc->bits <<= n;\n#endif\n    bc->bits_left -= n;\n}']