libavcodec/vima.c:152: error: Integer Overflow L2
  ([1, +oo] - 16):unsigned32 by call to `bitstream_read_signed`.

libavcodec/vima.c:152:19: Call
150.     avctx->channel_layout = (channels == 2) ? AV_CH_LAYOUT_STEREO
151.                                             : AV_CH_LAYOUT_MONO;
152.     pcm_data[0] = bitstream_read_signed(&bc, 16);
                       ^
153.     if (channels > 1) {
154.         channel_hint[1] = bitstream_read_signed(&bc, 8);

libavcodec/bitstream.h:199:1: Parameter `n`
  197. /* Return n bits from the buffer as a signed integer.
  198.  * n has to be in the 0-32 range. */
  199. static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)
       ^
  200. {
  201.     return sign_extend(bitstream_read(bc, n), n);

libavcodec/bitstream.h:201:24: Call
  199. static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)
  200. {
  201.     return sign_extend(bitstream_read(bc, n), n);
                              ^
  202. }
  203. 

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] - 16):unsigned32 by call to `bitstream_read_signed` 
      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 int decode_frame(AVCodecContext *avctx, void *data,\n                        int *got_frame_ptr, AVPacket *pkt)\n{\n    BitstreamContext bc;\n    AVFrame *frame = data;\n    int16_t pcm_data[2];\n    uint32_t samples;\n    int8_t channel_hint[2];\n    int ret, chan;\n    int channels = 1;\n    if (pkt->size < 13)\n        return AVERROR_INVALIDDATA;\n    if ((ret = bitstream_init8(&bc, pkt->data, pkt->size)) < 0)\n        return ret;\n    samples = bitstream_read(&bc, 32);\n    if (samples == 0xffffffff) {\n        bitstream_skip(&bc, 32);\n        samples = bitstream_read(&bc, 32);\n    }\n    if (samples > pkt->size * 2)\n        return AVERROR_INVALIDDATA;\n    channel_hint[0] = bitstream_read_signed(&bc, 8);\n    if (channel_hint[0] & 0x80) {\n        channel_hint[0] = ~channel_hint[0];\n        channels = 2;\n    }\n    avctx->channels = channels;\n    avctx->channel_layout = (channels == 2) ? AV_CH_LAYOUT_STEREO\n                                            : AV_CH_LAYOUT_MONO;\n    pcm_data[0] = bitstream_read_signed(&bc, 16);\n    if (channels > 1) {\n        channel_hint[1] = bitstream_read_signed(&bc, 8);\n        pcm_data[1]     = bitstream_read_signed(&bc, 16);\n    }\n    frame->nb_samples = samples;\n    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)\n        return ret;\n    for (chan = 0; chan < channels; chan++) {\n        uint16_t *dest = (uint16_t *)frame->data[0] + chan;\n        int step_index = channel_hint[chan];\n        int output = pcm_data[chan];\n        int sample;\n        for (sample = 0; sample < samples; sample++) {\n            int lookup_size, lookup, highbit, lowbits;\n            step_index  = av_clip(step_index, 0, 88);\n            lookup_size = size_table[step_index];\n            lookup      = bitstream_read(&bc, lookup_size);\n            highbit     = 1 << (lookup_size - 1);\n            lowbits     = highbit - 1;\n            if (lookup & highbit)\n                lookup ^= highbit;\n            else\n                highbit = 0;\n            if (lookup == lowbits) {\n                output = bitstream_read_signed(&bc, 16);\n            } else {\n                int predict_index, diff;\n                predict_index = (lookup << (7 - lookup_size)) | (step_index << 6);\n                predict_index = av_clip(predict_index, 0, 5785);\n                diff          = predict_table[predict_index];\n                if (lookup)\n                    diff += ff_adpcm_step_table[step_index] >> (lookup_size - 1);\n                if (highbit)\n                    diff = -diff;\n                output = av_clip_int16(output + diff);\n            }\n            *dest = output;\n            dest += channels;\n            step_index += step_index_tables[lookup_size - 2][lookup];\n        }\n    }\n    *got_frame_ptr = 1;\n    return pkt->size;\n}', 'static inline int32_t bitstream_read_signed(BitstreamContext *bc, unsigned n)\n{\n    return sign_extend(bitstream_read(bc, 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}']