aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2012-02-03 10:43:21 -0800
committerAlex Converse <alex.converse@gmail.com>2012-03-06 15:28:01 -0800
commitce14f00dea933c930f46d1fb820dd02824a89fb4 (patch)
treebf8cd4cbeb13316756353949ad3ac3c468c2f49d /libavformat/mov.c
parent627f4621f5cb1a808e29026480570bd173c28d9b (diff)
downloadffmpeg-ce14f00dea933c930f46d1fb820dd02824a89fb4.tar.gz
movdec: Avoid av_malloc(0) in stss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind (cherry picked from commit 29a20ac4a19df5acc0eef306ca5a737778a31358)
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index c6022d5d3a..d14ae7ee0d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1503,6 +1503,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));