diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-09-19 11:29:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-15 22:53:56 +0200 |
commit | eeabdef1bf96cdecf80aeb8d0478d008457b048c (patch) | |
tree | b9313cd26ca5c310e0eb750c260e2402aa3a72f2 /libavcodec/sonic.c | |
parent | 92233a63444001477acb70f2afa43a05f10b5fd5 (diff) | |
download | ffmpeg-eeabdef1bf96cdecf80aeb8d0478d008457b048c.tar.gz |
avcodec/sonic: Check for overread
Fixes: Timeout (too long -> 1.3 sec)
Fixes: 24358/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5107284099989504
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/sonic.c')
-rw-r--r-- | libavcodec/sonic.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index e1d37f8780..0d4891ebf4 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -1031,6 +1031,9 @@ static int sonic_decode_frame(AVCodecContext *avctx, { int x = ch; + if (c.overread > MAX_OVERREAD) + return AVERROR_INVALIDDATA; + predictor_init_state(s->predictor_k, s->predictor_state[ch], s->num_taps); intlist_read(&c, state, s->coded_samples[ch], s->block_align, 1); |