Message ID | 20220917211557.11547-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | d0349c9929e2891c90011a83152624d5cf18e628 |
Headers | show |
Series | [FFmpeg-devel,1/9] avformat/ape: Check frames size | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Sat, Sep 17, 2022 at 11:15:49PM +0200, Michael Niedermayer wrote: > 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: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/ape.c | 2 ++ > 1 file changed, 2 insertions(+) will apply patchset [...]
diff --git a/libavformat/ape.c b/libavformat/ape.c index f904fde178c..92e9ac7cb1c 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -298,6 +298,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) {
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: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/ape.c | 2 ++ 1 file changed, 2 insertions(+)