From f694168d524d1c84f5f20f4260fcab1f4d8c11d7 Mon Sep 17 00:00:00 2001
From: Philip Gladstone <philipjsg@users.sourceforge.net>
Date: Mon, 9 Dec 2002 02:53:55 +0000
Subject: [PATCH] Fix a crash caused by a null coded_picture pointer in
 ffserver.

Originally committed as revision 1326 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/ffm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ffm.c b/libavformat/ffm.c
index cd7a174d062..2f247e422ef 100644
--- a/libavformat/ffm.c
+++ b/libavformat/ffm.c
@@ -232,7 +232,7 @@ static int ffm_write_packet(AVFormatContext *s, int stream_index,
     /* packet size & key_frame */
     header[0] = stream_index;
     header[1] = 0;
-    if (st->codec.coded_picture->key_frame)
+    if (st->codec.coded_picture && st->codec.coded_picture->key_frame)
         header[1] |= FLAG_KEY_FRAME;
     header[2] = (size >> 16) & 0xff;
     header[3] = (size >> 8) & 0xff;
-- 
GitLab