Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-03 01:43:21 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-12 23:21:51 +0300
commit7521f2f66cd51feaa668dd62377b311f6e6d48a0 (patch)
tree99d1224c6b94e7ffba031fd0fb2ba4568844ef24
parentcddda6d7e44b8a8a6805d60e43e0b652c8d72903 (diff)
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>
-rw-r--r--libavcodec/qdrw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 34c1442063..475cfecf5f 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -367,7 +367,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;