# HG changeset patch # User michael # Date 1161468421 0 # Node ID 6a05e683e7c44283732090c133f0178a7fa559dd # Parent 19f07b651d79b66a4ffbf906029e452a74e896fd prevent infinite loop diff -r 19f07b651d79 -r 6a05e683e7c4 mpegvideo.c --- a/mpegvideo.c Fri Oct 20 21:34:02 2006 +0000 +++ b/mpegvideo.c Sat Oct 21 22:07:01 2006 +0000 @@ -2536,7 +2536,7 @@ int max_size= rcc->buffer_index/3; if(put_bits_count(&s->pb) > max_size && s->qscale < s->avctx->qmax){ - s->next_lambda= s->lambda*(s->qscale+1) / s->qscale; + s->next_lambda= FFMAX(s->lambda+1, s->lambda*(s->qscale+1) / s->qscale); s->mb_skipped = 0; //done in MPV_frame_start() if(s->pict_type==P_TYPE){ //done in encode_picture() so we must undo it if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)