diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-20 20:51:36 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-21 23:42:11 +0300 |
commit | d2aff350bc8250d1efe04e90822f49f4b8aea9ae (patch) | |
tree | fef2ad555b7e8fe399a39fb8d6d77fea06472220 /libavcodec/cdtoons.c | |
parent | 4c31db5a32724662ac97448fd6ae2bfa42ffd732 (diff) |
avcodec/cdtoons: Fix off by 4 check on diff_size
Fixes: out of array read
Fixes: 20742/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDTOONS_fuzzer-5738148607033344
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>
Diffstat (limited to 'libavcodec/cdtoons.c')
-rw-r--r-- | libavcodec/cdtoons.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c index dc4fa6bf0b..d5dce6351f 100644 --- a/libavcodec/cdtoons.c +++ b/libavcodec/cdtoons.c @@ -269,7 +269,7 @@ static int cdtoons_decode_frame(AVCodecContext *avctx, void *data, diff_size = bytestream_get_be32(&buf); width = bytestream_get_be16(&buf); height = bytestream_get_be16(&buf); - if (diff_size < 4 || diff_size - 4 > eod - buf) { + if (diff_size < 8 || diff_size - 4 > eod - buf) { av_log(avctx, AV_LOG_WARNING, "Ran (seriously) out of data for Diff frame data.\n"); return AVERROR_INVALIDDATA; } |