aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov2012-09-21 08:30:42 +0200
committerAnton Khirnov2012-09-24 12:31:24 +0200
commit2bc0de385840466602341b9b151918fcf0934774 (patch)
tree25d86b578cba9ef31275545d9bd02b2120f85cda
parentc084a975aa13eb1d0161f36a06051a9b2d4abb83 (diff)
lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults()
-rw-r--r--libavcodec/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a3ab1344aa..63ea77f9fd 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -635,12 +635,16 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum
void avcodec_get_frame_defaults(AVFrame *frame)
{
+ if (frame->extended_data != frame->data)
+ av_freep(&frame->extended_data);
+
memset(frame, 0, sizeof(AVFrame));
frame->pts = AV_NOPTS_VALUE;
frame->key_frame = 1;
frame->sample_aspect_ratio = (AVRational) {0, 1 };
frame->format = -1; /* unknown */
+ frame->extended_data = frame->data;
}
AVFrame *avcodec_alloc_frame(void)