aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-06-15 02:07:41 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-06-15 02:07:41 +0000
commit53e099de8b3206af78312c00308225a558fffbef (patch)
tree60c48ef46c9332d296bfa932618f713a2cb6fa56 /libavformat
parent70606675801410371c8fbe2d369906882f303cdc (diff)
downloadffmpeg-53e099de8b3206af78312c00308225a558fffbef.tar.gz
check atom size against edit_count to avoid very long loop
Originally committed as revision 19198 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index af94394516..19e39339c8 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1831,6 +1831,9 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_be24(pb); /* flags */
edit_count = get_be32(pb); /* entries */
+ if((uint64_t)edit_count*12+8 > atom.size)
+ return -1;
+
for(i=0; i<edit_count; i++){
int time;
int duration = get_be32(pb); /* Track duration */