libavcodec/svq1dec.c:292: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`.

libavcodec/svq1dec.c:280:1: Parameter `bc->bits_left`
278. }
279. 
280. static int svq1_decode_motion_vector(BitstreamContext *bc, svq1_pmv *mv,
     ^
281.                                      svq1_pmv **pmv)
282. {

libavcodec/svq1dec.c:288:16: Call
286.     for (i = 0; i < 2; i++) {
287.         /* get motion code */
288.         diff = bitstream_read_vlc(bc, svq1_motion_component.table, 7, 2);
                    ^
289.         if (diff < 0)
290.             return AVERROR_INVALIDDATA;

libavcodec/bitstream.h:313:1: Parameter `(*table)[*]`
  311.  * If the VLC code is invalid and max_depth > 1, then the number of bits removed
  312.  * is undefined. */
  313. static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],
       ^
  314.                                      int bits, int max_depth)
  315. {

libavcodec/bitstream.h:319:5: Assignment
  317.     unsigned idx = bitstream_peek(bc, bits);
  318.     int code = table[idx][0];
  319.     int n    = table[idx][1];
           ^
  320. 
  321.     if (max_depth > 1 && n < 0) {

libavcodec/bitstream.h:329:5: Call
  327.         }
  328.     }
  329.     skip_remaining(bc, n);
           ^
  330. 
  331.     return code;

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

libavcodec/bitstream.h:237:5: Assignment
    235.     bc->bits <<= n;
    236. #endif
    237.     bc->bits_left -= n;
             ^
    238. }
    239. 

libavcodec/svq1dec.c:292:17: Call
290.             return AVERROR_INVALIDDATA;
291.         else if (diff) {
292.             if (bitstream_read_bit(bc))
                     ^
293.                 diff = -diff;
294.         }

libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
  143. 
  144. /* Return one bit from the buffer. */
  145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
       ^
  146. {
  147.     if (!bc->bits_left)

libavcodec/bitstream.h:150:12: Call
  148.         refill_64(bc);
  149. 
  150.     return get_val(bc, 1);
                  ^
  151. }
  152. 

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: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 
    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 svq1_decode_motion_vector(BitstreamContext *bc, svq1_pmv *mv,\n                                     svq1_pmv **pmv)\n{\n    int diff;\n    int i;\n    for (i = 0; i < 2; i++) {\n        diff = bitstream_read_vlc(bc, svq1_motion_component.table, 7, 2);\n        if (diff < 0)\n            return AVERROR_INVALIDDATA;\n        else if (diff) {\n            if (bitstream_read_bit(bc))\n                diff = -diff;\n        }\n        if (i == 1)\n            mv->y = sign_extend(diff + mid_pred(pmv[0]->y, pmv[1]->y, pmv[2]->y), 6);\n        else\n            mv->x = sign_extend(diff + mid_pred(pmv[0]->x, pmv[1]->x, pmv[2]->x), 6);\n    }\n    return 0;\n}', 'static inline int bitstream_read_vlc(BitstreamContext *bc, VLC_TYPE (*table)[2],\n                                     int bits, int max_depth)\n{\n    int nb_bits;\n    unsigned idx = bitstream_peek(bc, bits);\n    int code = table[idx][0];\n    int n    = table[idx][1];\n    if (max_depth > 1 && n < 0) {\n        skip_remaining(bc, bits);\n        code = set_idx(bc, code, &n, &nb_bits, table);\n        if (max_depth > 2 && n < 0) {\n            skip_remaining(bc, nb_bits);\n            code = set_idx(bc, code, &n, &nb_bits, table);\n        }\n    }\n    skip_remaining(bc, n);\n    return code;\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}', 'static inline unsigned bitstream_read_bit(BitstreamContext *bc)\n{\n    if (!bc->bits_left)\n        refill_64(bc);\n    return get_val(bc, 1);\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}']