summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2015-01-05 16:34:17 -0800
committerMichael Niedermayer <michaelni@gmx.at>2015-01-06 05:23:45 +0100
commit3ebd76a9c57558e284e94da367dd23b435e6a6d0 (patch)
tree9cca60ba4ccd4216da81c501e854635823962e96 /libavformat/mov.c
parent3859868c75313e318ebc5d0d33baada62d45dd75 (diff)
mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit size extension, it actually had that data available. The new code verfies there's enough data in the atom for this to be done. Failure to verify causes total_size > atom.size which will result in negative size calculations later on. Found-by: Paul Mehta <paul@paulmehta.com> Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f2a66b8a95..a157d60330 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3471,7 +3471,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
}
}
total_size += 8;
- if (a.size == 1) { /* 64 bit extended size */
+ if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */
a.size = avio_rb64(pb) - 8;
total_size += 8;
}