aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
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-02-03 10:44:04 -0800
commit29a20ac4a19df5acc0eef306ca5a737778a31358 (patch)
tree8d397bca631bd2d3d9369633cbb56893fe31e5dc /libavformat
parent58fc74005983fda6ea0a1e34f21f27827dad6a02 (diff)
downloadffmpeg-29a20ac4a19df5acc0eef306ca5a737778a31358.tar.gz
movdec: Avoid av_malloc(0) in stss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index d0e01f8e57..9deb820ebd 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));