[FFmpeg-cvslog] lavc: use av_mallocz to allocate AVFrames.

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


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Sep 24 07:17:13 2012 +0200| [c084a975aa13eb1d0161f36a06051a9b2d4abb83] | committer: Anton Khirnov

lavc: use av_mallocz to allocate AVFrames.

Otherwise the frame is uninitialized, so avcodec_get_frame_defaults()
cannot determine whether to free extended_data.

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

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

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 7ef8581..a3ab134 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -645,7 +645,7 @@ void avcodec_get_frame_defaults(AVFrame *frame)
 
 AVFrame *avcodec_alloc_frame(void)
 {
-    AVFrame *frame = av_malloc(sizeof(AVFrame));
+    AVFrame *frame = av_mallocz(sizeof(AVFrame));
 
     if (frame == NULL)
         return NULL;



More information about the ffmpeg-cvslog mailing list