# HG changeset patch # User michaelni # Date 1026928242 0 # Node ID 395bb978b9ffe5178df76f53adc0cc0e041fb484 # Parent 7e7a7282608c9d60a6df1878c9c94490efc063d1 fixing NULL reference frame with dr1 diff -r 7e7a7282608c -r 395bb978b9ff mpegvideo.c --- a/mpegvideo.c Wed Jul 17 15:54:56 2002 +0000 +++ b/mpegvideo.c Wed Jul 17 17:50:42 2002 +0000 @@ -637,6 +637,12 @@ for(i=0;i<3;i++) { if(avctx->flags&CODEC_FLAG_DR1) s->aux_picture[i]= avctx->dr_buffer[i]; + + //FIXME the following should never be needed, the decoder should drop b frames if no reference is available + if(s->next_picture[i]==NULL) + s->next_picture[i]= s->aux_picture[i]; + if(s->last_picture[i]==NULL) + s->last_picture[i]= s->next_picture[i]; s->current_picture[i] = s->aux_picture[i]; }