aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-04-16 17:38:39 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-05-06 00:22:26 +0200
commit6e98cf0280cd693ef82c4444fe15bc7aef8771b3 (patch)
tree3a7d2652b83b7364881db867628235c5a2c4fec7
parent19b66b89da4b4ff086dc1fc79bbf540e82bdbcb4 (diff)
downloadffmpeg-6e98cf0280cd693ef82c4444fe15bc7aef8771b3.tar.gz
avcodec/tiff: add a zero DNG_LINEARIZATION_TABLE check
Fixes: index 4294967295 out of bounds for type 'uint16_t [65536]' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5950405086674944 Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6666195176914944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tiff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 560cb3e5b3..148964590b 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1451,7 +1451,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
break;
case TIFF_GRAY_RESPONSE_CURVE:
case DNG_LINEARIZATION_TABLE:
- if (count > FF_ARRAY_ELEMS(s->dng_lut))
+ if (count < 1 || count > FF_ARRAY_ELEMS(s->dng_lut))
return AVERROR_INVALIDDATA;
for (int i = 0; i < count; i++)
s->dng_lut[i] = ff_tget(&s->gb, type, s->le);