summaryrefslogtreecommitdiff
path: root/libavcodec/atrac9dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-19 01:03:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-08-27 17:57:44 +0200
commitdead949a1fbf019647f5c8ea797d1c7be6615639 (patch)
tree259c6ef69384f7413bd20b3b0595a4d90d7a109a /libavcodec/atrac9dec.c
parent33a53722dc5ec4fcb2cf9c5e8b23566ff3b50577 (diff)
downloadffmpeg-dead949a1fbf019647f5c8ea797d1c7be6615639.tar.gz
avcodec/atrac9dec: Check block_align
Fixes: Infinite loop Fixes: 16260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5676365617037312 Fixes: 16260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5768093879500800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/atrac9dec.c')
-rw-r--r--libavcodec/atrac9dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c
index 4ea6ff0f31..46e60ca998 100644
--- a/libavcodec/atrac9dec.c
+++ b/libavcodec/atrac9dec.c
@@ -839,6 +839,11 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx)
av_lfg_init(&s->lfg, 0xFBADF00D);
+ if (avctx->block_align <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid block align\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (avctx->extradata_size != 12) {
av_log(avctx, AV_LOG_ERROR, "Invalid extradata length!\n");
return AVERROR_INVALIDDATA;