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
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1451,7 +1451,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) · 1450 unmodified lines | ||
| 1451 | 1451 | break; |
| 1452 | 1452 | case TIFF_GRAY_RESPONSE_CURVE: |
| 1453 | 1453 | case DNG_LINEARIZATION_TABLE: |
| 1454 | − if (count > FF_ARRAY_ELEMS(s->dng_lut)) | |
| 1454 | + if (count < 1 || count > FF_ARRAY_ELEMS(s->dng_lut)) | |
| 1455 | 1455 | return AVERROR_INVALIDDATA; |
| 1456 | 1456 | for (int i = 0; i < count; i++) |
| 1457 | 1457 | s->dng_lut[i] = ff_tget(&s->gb, type, s->le); |