mpegvideo_enc: fix a signed overflow

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 05795f35be)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Mans Rullgard 2011-10-09 20:32:58 +01:00 committed by Reinhard Tartler
parent 5e3ba60e6f
commit af0a56e6ef
1 changed files with 1 additions and 1 deletions

View File

@ -2006,7 +2006,7 @@ static int mb_var_thread(AVCodecContext *c, void *arg){
int varc;
int sum = s->dsp.pix_sum(pix, s->linesize);
varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500 + 128)>>8;
varc = (s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)sum*sum)>>8) + 500 + 128)>>8;
s->current_picture.mb_var [s->mb_stride * mb_y + mb_x] = varc;
s->current_picture.mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;