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

libavcodec/lagarith.c:137:5: Assignment
135.     int i, j, scale_factor;
136.     unsigned prob, cumulative_target;
137.     unsigned cumul_prob = 0;
         ^
138.     unsigned scaled_cumul_prob = 0;
139. 

libavcodec/lagarith.c:174:24: Call
172. 
173.     if (cumul_prob & (cumul_prob - 1)) {
174.         uint64_t mul = softfloat_reciprocal(cumul_prob);
                            ^
175.         for (i = 1; i < 257; i++) {
176.             rac->prob[i] = softfloat_mul(rac->prob[i], mul);

libavcodec/lagarith.c:64:1: <LHS trace>
62.  * @see softfloat_mul
63.  */
64. static uint64_t softfloat_reciprocal(uint32_t denom)
    ^
65. {
66.     int shift = av_log2(denom - 1) + 1;

libavcodec/lagarith.c:64:1: Parameter `denom`
  62.  * @see softfloat_mul
  63.  */
  64. static uint64_t softfloat_reciprocal(uint32_t denom)
      ^
  65. {
  66.     int shift = av_log2(denom - 1) + 1;

libavcodec/lagarith.c:66:17: Binary operation: ([0, +oo] - 1):unsigned32 by call to `softfloat_reciprocal` 
  64. static uint64_t softfloat_reciprocal(uint32_t denom)
  65. {
  66.     int shift = av_log2(denom - 1) + 1;
                      ^
  67.     uint64_t ret = (1ULL << 52) / denom;
  68.     uint64_t err = (1ULL << 52) - ret * denom;

static uint64_t softfloat_reciprocal(uint32_t denom)
{
    int shift = av_log2(denom - 1) + 1;
    uint64_t ret = (1ULL << 52) / denom;
    uint64_t err = (1ULL << 52) - ret * denom;
    ret <<= shift;
    err <<= shift;
    err +=  denom / 2;
    return ret + err / denom;
}
['static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)\n{\n    int i, j, scale_factor;\n    unsigned prob, cumulative_target;\n    unsigned cumul_prob = 0;\n    unsigned scaled_cumul_prob = 0;\n    rac->prob[0] = 0;\n    rac->prob[257] = UINT_MAX;\n    for (i = 1; i < 257; i++) {\n        if (lag_decode_prob(gb, &rac->prob[i]) < 0) {\n            av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\\n");\n            return -1;\n        }\n        if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) {\n            av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\\n");\n            return -1;\n        }\n        cumul_prob += rac->prob[i];\n        if (!rac->prob[i]) {\n            if (lag_decode_prob(gb, &prob)) {\n                av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\\n");\n                return -1;\n            }\n            if (prob > 257 - i)\n                prob = 257 - i;\n            for (j = 0; j < prob; j++)\n                rac->prob[++i] = 0;\n        }\n    }\n    if (!cumul_prob) {\n        av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\\n");\n        return -1;\n    }\n    scale_factor = av_log2(cumul_prob);\n    if (cumul_prob & (cumul_prob - 1)) {\n        uint64_t mul = softfloat_reciprocal(cumul_prob);\n        for (i = 1; i < 257; i++) {\n            rac->prob[i] = softfloat_mul(rac->prob[i], mul);\n            scaled_cumul_prob += rac->prob[i];\n        }\n        scale_factor++;\n        cumulative_target = 1 << scale_factor;\n        if (scaled_cumul_prob > cumulative_target) {\n            av_log(rac->avctx, AV_LOG_ERROR,\n                   "Scaled probabilities are larger than target!\\n");\n            return -1;\n        }\n        scaled_cumul_prob = cumulative_target - scaled_cumul_prob;\n        for (i = 1; scaled_cumul_prob; i = (i & 0x7f) + 1) {\n            if (rac->prob[i]) {\n                rac->prob[i]++;\n                scaled_cumul_prob--;\n            }\n        }\n    }\n    rac->scale = scale_factor;\n    for (i = 1; i < 257; i++)\n        rac->prob[i] += rac->prob[i - 1];\n    return 0;\n}', 'static uint64_t softfloat_reciprocal(uint32_t denom)\n{\n    int shift = av_log2(denom - 1) + 1;\n    uint64_t ret = (1ULL << 52) / denom;\n    uint64_t err = (1ULL << 52) - ret * denom;\n    ret <<= shift;\n    err <<= shift;\n    err +=  denom / 2;\n    return ret + err / denom;\n}']