[FFmpeg-cvslog] lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults()

Anton Khirnov git at videolan.org
Tue Sep 25 15:19:13 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Sep 21 08:30:42 2012 +0200| [2bc0de385840466602341b9b151918fcf0934774] | committer: Anton Khirnov

lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2bc0de385840466602341b9b151918fcf0934774
---

 libavcodec/utils.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a3ab134..63ea77f 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)



More information about the ffmpeg-cvslog mailing list