changeset 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 7a6ff8cc7c95
children f8a229dfa2e8
files mpegvideo.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Sun Nov 21 18:04:56 2004 +0000
+++ b/mpegvideo.c	Tue Nov 23 23:58:54 2004 +0000
@@ -2015,6 +2015,12 @@
                 for(i=0; i<s->max_b_frames+1; i++){
                     int pict_num= s->input_picture[0]->display_picture_number + i;
                     int pict_type= s->rc_context.entry[pict_num].new_pict_type;
+
+                    if(!s->input_picture[i]){
+                        if(i>0)
+                            s->rc_context.entry[pict_num-1].new_pict_type = P_TYPE;
+                        break;
+                    }
                     s->input_picture[i]->pict_type= pict_type;
                     
                     if(i + 1 >= s->rc_context.num_entries) break;