Mercurial > libavcodec.hg
comparison mpegvideo.c @ 2576:e237d9bd0f8c libavcodec
check mb/me_threshold range, fixes assertion failure
author | michael |
---|---|
date | Sat, 26 Mar 2005 18:10:44 +0000 |
parents | 682c57163e60 |
children | c07be5590462 |
comparison
equal
deleted
inserted
replaced
2575:0afef2899701 | 2576:e237d9bd0f8c |
---|---|
1050 if(s->avctx->thread_count > 1) | 1050 if(s->avctx->thread_count > 1) |
1051 s->rtp_mode= 1; | 1051 s->rtp_mode= 1; |
1052 | 1052 |
1053 if(!avctx->frame_rate || !avctx->frame_rate_base){ | 1053 if(!avctx->frame_rate || !avctx->frame_rate_base){ |
1054 av_log(avctx, AV_LOG_ERROR, "framerate not set\n"); | 1054 av_log(avctx, AV_LOG_ERROR, "framerate not set\n"); |
1055 return -1; | |
1056 } | |
1057 | |
1058 i= (INT_MAX/2+128)>>8; | |
1059 if(avctx->me_threshold >= i){ | |
1060 av_log(avctx, AV_LOG_ERROR, "me_threshold too large, max is %d\n", i - 1); | |
1061 return -1; | |
1062 } | |
1063 if(avctx->mb_threshold >= i){ | |
1064 av_log(avctx, AV_LOG_ERROR, "mb_threshold too large, max is %d\n", i - 1); | |
1055 return -1; | 1065 return -1; |
1056 } | 1066 } |
1057 | 1067 |
1058 i= ff_gcd(avctx->frame_rate, avctx->frame_rate_base); | 1068 i= ff_gcd(avctx->frame_rate, avctx->frame_rate_base); |
1059 if(i > 1){ | 1069 if(i > 1){ |