aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-11-16 13:40:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-11-16 13:40:56 +0000
commit096c3b7e9023f0f3b29c5aef7e32868ee1e729ea (patch)
treee3c8ce23bb6313cace6b4f3bf81e2680b1c5b930 /libavcodec/motion_est.c
parentdffcdbb5f67c5b710b10d745caadcd49cad6ab01 (diff)
downloadffmpeg-096c3b7e9023f0f3b29c5aef7e32868ee1e729ea.tar.gz
overflow fix
Originally committed as revision 3685 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index cf36d931a4..eebd8c2a34 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1017,7 +1017,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
if(p_type && USES_LIST(mb_type, 1)){
av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
- return INT_MAX;
+ return INT_MAX/4;
}
assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
@@ -1035,7 +1035,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
- return INT_MAX;
+ return INT_MAX/4;
}
if(USES_LIST(mb_type, 0)){
@@ -1096,7 +1096,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
}else if(IS_8X8(mb_type)){
if(!(s->flags & CODEC_FLAG_4MV)){
av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
- return INT_MAX;
+ return INT_MAX/4;
}
cmpf= s->dsp.sse[1];
chroma_cmpf= s->dsp.sse[1];