Skip to content
Snippets Groups Projects
Unverified Commit fe862271 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avformat/ape: Check frames size

Fixes: signed integer overflow: 9223372036854775806 + 3 cannot be represented in type 'long'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APE_fuzzer-6389264140599296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d0349c99)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1ccd4a9e
No related branches found
No related tags found
No related merge requests found
......@@ -325,6 +325,8 @@ static int ape_read_header(AVFormatContext * s)
ape->frames[i].pos -= ape->frames[i].skip;
ape->frames[i].size += ape->frames[i].skip;
}
if (ape->frames[i].size > INT_MAX - 3)
return AVERROR_INVALIDDATA;
ape->frames[i].size = (ape->frames[i].size + 3) & ~3;
}
if (ape->fileversion < 3810) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment