diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index fd70cc9782b1e78a728b7a138236355108652638..86591aae46a3b918edf22d13335814e4451f9cbd 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -52,6 +52,7 @@ typedef struct RawVideoContext {
     unsigned char * buffer;  /* block of memory for holding one frame */
     unsigned char * p;       /* current position in buffer */
     int             length;  /* number of bytes in buffer */
+    AVFrame pic;             ///< AVCodecContext.coded_frame
 } RawVideoContext;
 
 
@@ -67,6 +68,10 @@ static int raw_init(AVCodecContext *avctx)
 	context->buffer = av_malloc(context->length);
 	context->p      = context->buffer;
 
+    context->pic.pict_type= FF_I_TYPE;
+    context->pic.key_frame= 1;
+    avctx->coded_frame= &context->pic;
+    
     if (! context->buffer) {
         return -1;
     }