[Ffmpeg-cvslog] r6753 - trunk/libavcodec/mpegvideo.c

michael subversion
Sun Oct 22 00:07:09 CEST 2006


Author: michael
Date: Sun Oct 22 00:07:01 2006
New Revision: 6753

Modified:
   trunk/libavcodec/mpegvideo.c

Log:
prevent infinite loop


Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c	(original)
+++ trunk/libavcodec/mpegvideo.c	Sun Oct 22 00:07:01 2006
@@ -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)




More information about the ffmpeg-cvslog mailing list