aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-08-02 00:51:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-10-05 21:28:08 +0200
commitc9a546aedaa4eb8754cff96457fe612f58eec62e (patch)
tree9018f43d281566375468548b77484c5d11375e94
parent185a720a4d0770ee1ae991eb27b5f97b03c84ae2 (diff)
downloadffmpeg-c9a546aedaa4eb8754cff96457fe612f58eec62e.tar.gz
avformat/mov: Check comp_brand_size
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 24457/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5760093644390400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ffa6072fc727a14680a85449259f6b49b47587e6) 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 094134aa59..a9e63e4b40 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1117,7 +1117,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dict_set_int(&c->fc->metadata, "minor_version", minor_ver, 0);
comp_brand_size = atom.size - 8;
- if (comp_brand_size < 0)
+ if (comp_brand_size < 0 || comp_brand_size == INT_MAX)
return AVERROR_INVALIDDATA;
comp_brands_str = av_malloc(comp_brand_size + 1); /* Add null terminator */
if (!comp_brands_str)