aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-03-26 18:10:44 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-03-26 18:10:44 +0000
commitcec1f05fd7d64c208388b6c57f82a8bc75f4981e (patch)
treed90bb26985f5864813d852e17ff670379f361656 /libavcodec/mpegvideo.c
parent71434945f20c6d340b4c942de7746e6ea46ec74b (diff)
downloadffmpeg-cec1f05fd7d64c208388b6c57f82a8bc75f4981e.tar.gz
check mb/me_threshold range, fixes assertion failure
Originally committed as revision 4082 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 50d44c972f..4dfd18c539 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1054,6 +1054,16 @@ int MPV_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
return -1;
}
+
+ i= (INT_MAX/2+128)>>8;
+ if(avctx->me_threshold >= i){
+ av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", i - 1);
+ return -1;
+ }
+ if(avctx->mb_threshold >= i){
+ av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1);
+ return -1;
+ }
i= ff_gcd(avctx->frame_rate, avctx->frame_rate_base);
if(i > 1){