check mb/me_threshold range, fixes assertion failure
Originally committed as revision 4082 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
71434945f2
commit
cec1f05fd7
@ -1016,7 +1016,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
|
|||||||
|
|
||||||
if(p_type && USES_LIST(mb_type, 1)){
|
if(p_type && USES_LIST(mb_type, 1)){
|
||||||
av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
|
av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
|
||||||
return INT_MAX/4;
|
return INT_MAX/2;
|
||||||
}
|
}
|
||||||
assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
|
assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
|
||||||
|
|
||||||
@ -1034,7 +1034,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
|
|||||||
|
|
||||||
if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
|
if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
|
||||||
av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
|
av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
|
||||||
return INT_MAX/4;
|
return INT_MAX/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(USES_LIST(mb_type, 0)){
|
if(USES_LIST(mb_type, 0)){
|
||||||
@ -1095,7 +1095,7 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
|
|||||||
}else if(IS_8X8(mb_type)){
|
}else if(IS_8X8(mb_type)){
|
||||||
if(!(s->flags & CODEC_FLAG_4MV)){
|
if(!(s->flags & CODEC_FLAG_4MV)){
|
||||||
av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
|
av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
|
||||||
return INT_MAX/4;
|
return INT_MAX/2;
|
||||||
}
|
}
|
||||||
cmpf= s->dsp.sse[1];
|
cmpf= s->dsp.sse[1];
|
||||||
chroma_cmpf= s->dsp.sse[1];
|
chroma_cmpf= s->dsp.sse[1];
|
||||||
|
@ -1054,6 +1054,16 @@ int MPV_encode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
|
av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
|
||||||
return -1;
|
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);
|
i= ff_gcd(avctx->frame_rate, avctx->frame_rate_base);
|
||||||
if(i > 1){
|
if(i > 1){
|
||||||
|
Loading…
Reference in New Issue
Block a user