summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-09 04:02:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-09 04:02:03 +0200
commitc5db8b4d09762f5228eaf3c3a0017657ed27d866 (patch)
tree59719cfc31a9e112b3f7099392506a6e1e54449f /libavcodec/motion_est.c
parent7fb92be7e50ea4ba5712804326c6814ae02dd190 (diff)
parenta31e9f68a426f634e002282885c6c2eb1bfbea44 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavf: fix signed overflow in avformat_find_stream_info() vp8: fix signed overflows motion_est: fix some signed overflows dca: fix signed overflow in shift aacdec: fix undefined shifts bink: Check for various out of bound writes bink: Check for out of bound writes when building tree put_bits: fix invalid shift by 32 in flush_put_bits() Conflicts: libavcodec/bink.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 2517da5f9d..c8af093653 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1016,7 +1016,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
/* intra / predictive decision */
pix = c->src[0][0];
sum = s->dsp.pix_sum(pix, s->linesize);
- varc = s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)(sum*sum))>>8) + 500;
+ varc = s->dsp.pix_norm1(pix, s->linesize) - (((unsigned)sum*sum)>>8) + 500;
pic->mb_mean[s->mb_stride * mb_y + mb_x] = (sum+128)>>8;
pic->mb_var [s->mb_stride * mb_y + mb_x] = (varc+128)>>8;
@@ -1178,7 +1178,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if((c->avctx->mb_cmp&0xFF)==FF_CMP_SSE){
intra_score= varc - 500;
}else{
- int mean= (sum+128)>>8;
+ unsigned mean = (sum+128)>>8;
mean*= 0x01010101;
for(i=0; i<16; i++){