diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-09-30 00:51:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-03-26 00:08:25 +0100 |
commit | 50d8e4f27398fd5778485a827d7a2817921f8540 (patch) | |
tree | 56956e1b8348b3fb206e18ffce9eda59402232dd | |
parent | d973fcbcc2f944752ff10e6a76b0b2d9329937a7 (diff) | |
download | ffmpeg-50d8e4f27398fd5778485a827d7a2817921f8540.tar.gz |
avformat/dxa: Adjust order of operations around block align
Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-5730576523198464
Fixes: signed integer overflow: 2147483566 + 82 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/dxa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/dxa.c b/libavformat/dxa.c index 58757e8358..813e665a27 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -123,7 +123,7 @@ static int dxa_read_header(AVFormatContext *s) if(ast->codecpar->block_align) { if (c->bpc > INT_MAX - ast->codecpar->block_align + 1) return AVERROR_INVALIDDATA; - c->bpc = ((c->bpc + ast->codecpar->block_align - 1) / ast->codecpar->block_align) * ast->codecpar->block_align; + c->bpc = ((c->bpc - 1 + ast->codecpar->block_align) / ast->codecpar->block_align) * ast->codecpar->block_align; } c->bytes_left = fsize; c->wavpos = avio_tell(pb); |