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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/51/head
Michael Niedermayer 11 years ago
parent 3f307d79d3
commit 241eccd628
  1. 6
      libavcodec/mpegvideo_enc.c

@ -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;
}
}
}

Loading…
Cancel
Save