ratecontrol: Fix assertion failure on mismatching 2pass file.

Fixes Ticket582

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-24 03:03:17 +01:00
parent 66244baf1d
commit f1470ca685

View File

@ -691,7 +691,10 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
if(s->flags&CODEC_FLAG_PASS2){
assert(picture_number>=0);
assert(picture_number<rcc->num_entries);
if(picture_number >= rcc->num_entries) {
av_log(s, AV_LOG_ERROR, "Input is longer than 2-pass log file\n");
return -1;
}
rce= &rcc->entry[picture_number];
wanted_bits= rce->expected_bits;
}else{