[FFmpeg-cvslog] movdec: Avoid av_malloc(0) in stss

Alex Converse git at videolan.org
Sat Feb 4 03:31:50 CET 2012


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Fri Feb  3 10:43:21 2012 -0800| [29a20ac4a19df5acc0eef306ca5a737778a31358] | committer: Alex Converse

movdec: Avoid av_malloc(0) in stss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

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

 libavformat/mov.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d0e01f8..9deb820 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1529,6 +1529,8 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
     av_dlog(c->fc, "keyframe_count = %d\n", entries);
 
+    if (!entries)
+        return 0;
     if (entries >= UINT_MAX / sizeof(int))
         return AVERROR_INVALIDDATA;
     sc->keyframes = av_malloc(entries * sizeof(int));



More information about the ffmpeg-cvslog mailing list