From: John Koleszar Date: Wed, 29 Jun 2011 18:36:51 +0000 (-0700) Subject: Merge "guard against space/time distortion" X-Git-Tag: v0.9.7~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=034cea5e726b851294baad4d77e81bb6ce45703c;p=libvpx Merge "guard against space/time distortion" --- 034cea5e726b851294baad4d77e81bb6ce45703c diff --cc vpxenc.c index 82f9071c4,775a22b27..042f07b81 --- a/vpxenc.c +++ b/vpxenc.c @@@ -1347,8 -1342,10 +1347,10 @@@ static void update_rate_histogram(struc if(now < cfg->rc_buf_initial_sz) return; + then = now; + /* Sum the size over the past rc_buf_sz ms */ - for(i = hist->frames; i > 0; i--) + for(i = hist->frames; i > 0 && hist->frames - i < hist->samples; i--) { int i_idx = (i-1) % hist->samples;