[FFmpeg-cvslog] avcodec_alloc_frame: dont zero the whole struct twice

Michael Niedermayer git at videolan.org
Tue Sep 25 18:11:11 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep 25 17:36:17 2012 +0200| [8deddc696139433d2de0dc44e4f3a2a33717ea12] | committer: Michael Niedermayer

avcodec_alloc_frame: dont zero the whole struct twice

cleaning it up is already done in avcodec_get_frame_defaults()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/utils.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b95b419..00434c9 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -720,11 +720,12 @@ void avcodec_get_frame_defaults(AVFrame *frame)
 
 AVFrame *avcodec_alloc_frame(void)
 {
-    AVFrame *frame = av_mallocz(sizeof(AVFrame));
+    AVFrame *frame = av_malloc(sizeof(AVFrame));
 
     if (frame == NULL)
         return NULL;
 
+    frame->extended_data = NULL;
     avcodec_get_frame_defaults(frame);
 
     return frame;



More information about the ffmpeg-cvslog mailing list