Browse Source

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 2acbbe2623)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
76f387bbad
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/atrac3.c

+ 1
- 1
libavcodec/atrac3.c View File

@@ -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) +


Loading…
Cancel
Save