comparison mpegvideo.c @ 2363:e0bda0b8359a libavcodec

Fixes a segfault when flushing delayed B-frames on the 2nd pass. patch by (Loren Merritt <lorenm.u@washington@edu>)
author michael
date Tue, 23 Nov 2004 23:58:54 +0000
parents ada3891b859d
children f8a229dfa2e8
comparison
equal deleted inserted replaced
2362:7a6ff8cc7c95 2363:e0bda0b8359a
2013 2013
2014 if(s->flags&CODEC_FLAG_PASS2){ 2014 if(s->flags&CODEC_FLAG_PASS2){
2015 for(i=0; i<s->max_b_frames+1; i++){ 2015 for(i=0; i<s->max_b_frames+1; i++){
2016 int pict_num= s->input_picture[0]->display_picture_number + i; 2016 int pict_num= s->input_picture[0]->display_picture_number + i;
2017 int pict_type= s->rc_context.entry[pict_num].new_pict_type; 2017 int pict_type= s->rc_context.entry[pict_num].new_pict_type;
2018
2019 if(!s->input_picture[i]){
2020 if(i>0)
2021 s->rc_context.entry[pict_num-1].new_pict_type = P_TYPE;
2022 break;
2023 }
2018 s->input_picture[i]->pict_type= pict_type; 2024 s->input_picture[i]->pict_type= pict_type;
2019 2025
2020 if(i + 1 >= s->rc_context.num_entries) break; 2026 if(i + 1 >= s->rc_context.num_entries) break;
2021 } 2027 }
2022 } 2028 }