Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-01-17 16:26:05 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-06 21:27:35 +0300
commit673f8d3641ced5c25862815ec458a4c9820c5162 (patch)
tree3e451e03edd724ec9f696b7d97a93ca9b19bbd40 /libavformat
parent447b9a0f030653cc6687905cc642453fa2063284 (diff)
avformat/mov: Check size before subtraction
Fixes: signed integer overflow: -9223372036854775808 - 8 cannot be represented in type 'long' Fixes: 43542/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5237670148702208 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 d8d9d506a3de976b647bcbb8f76c7b8d30eff576) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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 47160fd551..092c899fff 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7078,6 +7078,8 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (a.size == 0) {
a.size = atom.size - total_size + 8;
}
+ if (a.size < 0)
+ break;
a.size -= 8;
if (a.size < 0)
break;