Fix a crash caused by a null coded_picture pointer in ffserver.
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 9 Dec 2002 02:53:55 +0000 (02:53 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 9 Dec 2002 02:53:55 +0000 (02:53 +0000)
Originally committed as revision 1326 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/ffm.c

index cd7a174d0627ab2bfcaaf731137e71e83badd863..2f247e422ef7753b648aea2545643d1795eee2f2 100644 (file)
@@ -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;