diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-03 00:43:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-21 22:19:37 +0200 |
commit | 5c3262e82b7b028e0c5d38fee90ac1b31e604a41 (patch) | |
tree | 016edc51a01af5479da7c453dc911136383a7cdf /libavcodec | |
parent | 8618061a4f589276d2f533de7108fa561a6bd524 (diff) | |
download | ffmpeg-5c3262e82b7b028e0c5d38fee90ac1b31e604a41.tar.gz |
avcodec/qdrw: adjust max colors to array size
Fixes: out of array access
Fixes: 48429/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDRAW_fuzzer-4608329791438848
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 cd847f86d31f87f0f7733ca6ab7a2c022a1398bd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qdrw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 0452086be3..b17fb59f3e 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -216,7 +216,7 @@ static int decode_frame(AVCodecContext *avctx, bytestream2_skip(&gbc, 18); colors = bytestream2_get_be16(&gbc); - if (colors < 0 || colors > 256) { + if (colors < 0 || colors > 255) { av_log(avctx, AV_LOG_ERROR, "Error color count - %i(0x%X)\n", colors, colors); return AVERROR_INVALIDDATA; |