提交 2bc0de38 编写于 作者: A Anton Khirnov

lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults()

上级 c084a975
...@@ -635,12 +635,16 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum ...@@ -635,12 +635,16 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum
void avcodec_get_frame_defaults(AVFrame *frame) void avcodec_get_frame_defaults(AVFrame *frame)
{ {
if (frame->extended_data != frame->data)
av_freep(&frame->extended_data);
memset(frame, 0, sizeof(AVFrame)); memset(frame, 0, sizeof(AVFrame));
frame->pts = AV_NOPTS_VALUE; frame->pts = AV_NOPTS_VALUE;
frame->key_frame = 1; frame->key_frame = 1;
frame->sample_aspect_ratio = (AVRational) {0, 1 }; frame->sample_aspect_ratio = (AVRational) {0, 1 };
frame->format = -1; /* unknown */ frame->format = -1; /* unknown */
frame->extended_data = frame->data;
} }
AVFrame *avcodec_alloc_frame(void) AVFrame *avcodec_alloc_frame(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册