diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-28 15:20:00 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-28 15:20:00 +0000 |
commit | 1928d04640208a7638a769fce99ed335fbc05963 (patch) | |
tree | 923d98ebdddcd842403c89bec60456728f16b0b3 | |
parent | ea7307df2097211ae1294ae5aa057f15a5134291 (diff) | |
download | ffmpeg-1928d04640208a7638a769fce99ed335fbc05963.tar.gz |
prevent overflow if lambda2 is "too" large
Originally committed as revision 6823 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mpegvideo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 30aa86d6df..47a9514aa1 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -5579,7 +5579,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) /* Estimate motion for every MB */ if(s->pict_type != I_TYPE){ s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; - s->lambda2= (s->lambda2* s->avctx->me_penalty_compensation + 128)>>8; + s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8; if(s->pict_type != B_TYPE && s->avctx->me_threshold==0){ if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ s->avctx->execute(s->avctx, pre_estimate_motion_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count); |