libavcodec/loco.c:91: error: Integer Overflow L2
  ([1, +oo] - [1, 9]):unsigned32 by call to `get_ur_golomb_jpegls`.

libavcodec/loco.c:91:38: Call
89.         return 0;
90.     }
91.     v = get_ur_golomb_jpegls(&r->bc, loco_get_rice_param(r), INT_MAX, 0);
                                         ^
92.     loco_update_rice_param(r, (v + 1) >> 1);
93.     if (!v) {

libavcodec/loco.c:61:5: Assignment
  59. static int loco_get_rice_param(RICEContext *r)
  60. {
  61.     int cnt = 0;
          ^
  62.     int val = r->count;
  63. 

libavcodec/loco.c:69:5: Assignment
  67.     }
  68. 
  69.     return cnt;
          ^
  70. }
  71. 

libavcodec/loco.c:91:9: Call
89.         return 0;
90.     }
91.     v = get_ur_golomb_jpegls(&r->bc, loco_get_rice_param(r), INT_MAX, 0);
            ^
92.     loco_update_rice_param(r, (v + 1) >> 1);
93.     if (!v) {

libavcodec/golomb.h:275:1: Parameter `k`
  273.  * read unsigned golomb rice code (jpegls).
  274.  */
  275. static inline int get_ur_golomb_jpegls(BitstreamContext *bc, int k, int limit,
       ^
  276.                                        int esc_len)
  277. {

libavcodec/golomb.h:298:19: Call
  296. 
  297.         if (i < limit - 1) {
  298.             buf = bitstream_read(bc, k);
                         ^
  299. 
  300.             return buf + (i << k);

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] - [1, 9]):unsigned32 by call to `get_ur_golomb_jpegls` 
      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 inline int loco_get_rice(RICEContext *r)\n{\n    int v;\n    if (r->run > 0) {\n        r->run--;\n        loco_update_rice_param(r, 0);\n        return 0;\n    }\n    v = get_ur_golomb_jpegls(&r->bc, loco_get_rice_param(r), INT_MAX, 0);\n    loco_update_rice_param(r, (v + 1) >> 1);\n    if (!v) {\n        if (r->save >= 0) {\n            r->run = get_ur_golomb_jpegls(&r->bc, 2, INT_MAX, 0);\n            if (r->run > 1)\n                r->save += r->run + 1;\n            else\n                r->save -= 3;\n        } else\n            r->run2++;\n    } else {\n        v = ((v >> 1) + r->lossy) ^ -(v & 1);\n        if (r->run2 > 0) {\n            if (r->run2 > 2)\n                r->save += r->run2;\n            else\n                r->save -= 3;\n            r->run2 = 0;\n        }\n    }\n    return v;\n}', 'static int loco_get_rice_param(RICEContext *r)\n{\n    int cnt = 0;\n    int val = r->count;\n    while (r->sum > val && cnt < 9) {\n        val <<= 1;\n        cnt++;\n    }\n    return cnt;\n}', 'static inline int get_ur_golomb_jpegls(BitstreamContext *bc, int k, int limit,\n                                       int esc_len)\n{\n    unsigned int buf;\n    int log;\n    buf = bitstream_peek(bc, 32);\n    log = av_log2(buf);\n    if (log - k >= 1 && 32 - log < limit) {\n        buf >>= log - k;\n        buf  += (30 - log) << k;\n        bitstream_skip(bc, 32 + k - log);\n        return buf;\n    } else {\n        int i;\n        for (i = 0;\n             i < limit && bitstream_read_bit(bc) == 0 && bitstream_bits_left(bc) > 0;\n             i++);\n        if (i < limit - 1) {\n            buf = bitstream_read(bc, k);\n            return buf + (i << k);\n        } else if (i == limit - 1) {\n            buf = bitstream_read(bc, esc_len);\n            return buf + 1;\n        } else\n            return -1;\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}']