[FFmpeg-cvslog] mov: Don't allocate arrays with av_malloc that will be realloced

Martin Storsjö git at videolan.org
Sat Oct 5 10:57:41 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Oct  4 09:52:02 2013 +0300| [b698542ad83284fbb8c22404e3cafeb2dd739d38] | committer: Martin Storsjö

mov: Don't allocate arrays with av_malloc that will be realloced

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/mov.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index e1f2db2..60fb999 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2373,7 +2373,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (!sc->ctts_count && sc->sample_count)
     {
         /* Complement ctts table if moov atom doesn't have ctts atom. */
-        ctts_data = av_malloc(sizeof(*sc->ctts_data));
+        ctts_data = av_realloc(NULL, sizeof(*sc->ctts_data));
         if (!ctts_data)
             return AVERROR(ENOMEM);
         sc->ctts_data = ctts_data;



More information about the ffmpeg-cvslog mailing list