aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-25 20:51:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-06 20:30:57 +0100
commite5ea4e727c5523d78b3569b519228f5d251b02bd (patch)
tree7e476f2d6b0d099acfc6a13d5f35dda231f4a2cb
parente60504a71dcbfa7ec4a7023209cd0e373f18043c (diff)
downloadffmpeg-e5ea4e727c5523d78b3569b519228f5d251b02bd.tar.gz
avcodec/atrac3: Check block_align
Fixes: Infinite loop Fixes: 17620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5086123012915200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2acbbe262325187d87e8881c2984d203fb54207e) 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 4bdb63f98b..922fa4961e 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -882,7 +882,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
- if (avctx->block_align >= UINT_MAX / 2)
+ if (avctx->block_align >= UINT_MAX / 2 || avctx->block_align <= 0)
return AVERROR(EINVAL);
q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +