mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
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>
This commit is contained in:
parent
a33ae75225
commit
e42732b91f
@ -5768,6 +5768,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user