aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-20 23:51:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commitf75b377857d34b6e797d918eae4625e387b27950 (patch)
tree06b7a77a4d5adbc5b325a2549a02188a8df48a9c
parent96ccd5665c5582e53feb7ee9d8dda6825bf05df6 (diff)
downloadffmpeg-f75b377857d34b6e797d918eae4625e387b27950.tar.gz
avcodec/atrac3: Check for huge block aligns
The largest documented frame size = block align is 1024 bytes (https://wiki.multimedia.cx/index.php/ATRAC3) Without a limit this can allocate arbitrary memory and trigger OOM Fixes: OOM Fixes: 18337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5763861478637568 Fixes: 18556/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3AL_fuzzer-5646183334936576 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 f09151fff9c754fbc1d2560adf18b14957f8b181) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/atrac3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index dc19a3863e..067aa23f1f 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -964,7 +964,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- if (avctx->block_align >= UINT_MAX / 2 || avctx->block_align <= 0)
+ if (avctx->block_align > 1024 || avctx->block_align <= 0)
return AVERROR(EINVAL);
q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +