Commit 95342235 authored by Michael Niedermayer's avatar Michael Niedermayer

segfault fix

Originally committed as revision 1784 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c9b99ea6
...@@ -52,6 +52,7 @@ typedef struct RawVideoContext { ...@@ -52,6 +52,7 @@ typedef struct RawVideoContext {
unsigned char * buffer; /* block of memory for holding one frame */ unsigned char * buffer; /* block of memory for holding one frame */
unsigned char * p; /* current position in buffer */ unsigned char * p; /* current position in buffer */
int length; /* number of bytes in buffer */ int length; /* number of bytes in buffer */
AVFrame pic; ///< AVCodecContext.coded_frame
} RawVideoContext; } RawVideoContext;
...@@ -67,6 +68,10 @@ static int raw_init(AVCodecContext *avctx) ...@@ -67,6 +68,10 @@ static int raw_init(AVCodecContext *avctx)
context->buffer = av_malloc(context->length); context->buffer = av_malloc(context->length);
context->p = context->buffer; context->p = context->buffer;
context->pic.pict_type= FF_I_TYPE;
context->pic.key_frame= 1;
avctx->coded_frame= &context->pic;
if (! context->buffer) { if (! context->buffer) {
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment