mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-10-19 09:53:18 +00:00
avformat/dxa: check bpc
Fixes: integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 373971762/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-4880491112103936
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 7e020f2141
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
201f2c5912
commit
ce9505775a
1 changed files with 2 additions and 0 deletions
|
@ -119,6 +119,8 @@ static int dxa_read_header(AVFormatContext *s)
|
|||
avio_skip(pb, fsize);
|
||||
}
|
||||
c->bpc = (fsize + (int64_t)c->frames - 1) / c->frames;
|
||||
if (c->bpc < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if(ast->codecpar->block_align) {
|
||||
if (c->bpc > INT_MAX - ast->codecpar->block_align + 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue