From ca15919699545e462301ceb00fab4f65b9e068e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Wed, 1 Jun 2005 12:03:25 +0000 Subject: [PATCH] fix segfault if flush is called before the first frame (I think that's it, and this fixes it) Originally committed as revision 4335 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index fa419e8981..f7475d09ef 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3505,7 +3505,8 @@ static void flush_dpb(AVCodecContext *avctx){ h->delayed_pic[i]= NULL; h->delayed_output_pic= NULL; idr(h); - h->s.current_picture_ptr->reference= 0; + if(h->s.current_picture_ptr) + h->s.current_picture_ptr->reference= 0; } /**