Commit 241eccd6 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_enc: fix integer overflow with -skip_exp >= 2

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3f307d79
......@@ -1148,9 +1148,9 @@ static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
switch (s->avctx->frame_skip_exp) {
case 0: score = FFMAX(score, v); break;
case 1: score += FFABS(v); break;
case 2: score += v * v; break;
case 3: score64 += FFABS(v * v * (int64_t)v); break;
case 4: score64 += v * v * (int64_t)(v * v); break;
case 2: score64 += v * (int64_t)v; break;
case 3: score64 += FFABS(v * (int64_t)v * v); break;
case 4: score64 += (v * (int64_t)v) * (v * (int64_t)v); break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment