mov: avoid a memleak when multiple stss boxes are present
authorAnton Khirnov <anton@khirnov.net>
Tue, 12 Aug 2014 14:39:10 +0000 (14:39 +0000)
committerAnton Khirnov <anton@khirnov.net>
Sat, 20 Dec 2014 10:09:46 +0000 (11:09 +0100)
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 64f7575fbd64e5b65d5c644347408588c776f1fe)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 577f1feb3fd1e51fd14af7ce6d79d468faa3b929)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 931f5b235112f1c2a09dead36f0a228061d23942)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/mov.c

index 4453d6d..e2d3f93 100644 (file)
@@ -1530,6 +1530,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
     if (entries >= UINT_MAX / sizeof(int))
         return AVERROR_INVALIDDATA;
+    av_freep(&sc->keyframes);
     sc->keyframes = av_malloc(entries * sizeof(int));
     if (!sc->keyframes)
         return AVERROR(ENOMEM);