aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka-at-google.com@ffmpeg.org>2017-08-20 11:56:47 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-24 12:03:52 +0200
commit05fc22f9f69e56a76a52d5287d966d6d66b55ab2 (patch)
tree5f45f34116f6898aedce9a2ba226af4d9944ae8b
parentcab75cde01709c56877948552eeaac5e71d55b14 (diff)
downloadffmpeg-05fc22f9f69e56a76a52d5287d966d6d66b55ab2.tar.gz
avformat/mov: Fix signed integer overflows with total_size
Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow Signed-off-by: Vitaly Buka <vitalybuka@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4a404cb5b90b878cbe1bb528fac65cf508668cc5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 017df0fbc0..478b50b5b2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3979,7 +3979,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (atom.size < 0)
atom.size = INT64_MAX;
- while (total_size + 8 <= atom.size && !avio_feof(pb)) {
+ while (total_size <= atom.size - 8 && !avio_feof(pb)) {
int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL;
a.size = atom.size;
a.type=0;