diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-08-20 00:59:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:20 +0100 |
commit | 2e3de433c7d48400832830600b67a971e0c211c7 (patch) | |
tree | d11492ea3f49500e82cc182916fef8c4230cc707 | |
parent | b31916c31345c89cd0ebffc5ad0c3d448de53b37 (diff) | |
download | ffmpeg-2e3de433c7d48400832830600b67a971e0c211c7.tar.gz |
avcodec/tiff: Avoid abort with DNG RAW TIFF with YA8
Fixes: Assertion failure
Fixes: 24707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5179910197608448
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ca47402a06922f5280b4526007e32bf7847c7430)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/tiff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 8c0b6f0853..8a5f6e030d 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -709,7 +709,7 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid if (is_dng) { int is_u16, pixel_size_bytes, pixel_size_bits, elements; - is_u16 = (s->bpp > 8); + is_u16 = (s->bpp / s->bppcount > 8); pixel_size_bits = (is_u16 ? 16 : 8); pixel_size_bytes = (is_u16 ? sizeof(uint16_t) : sizeof(uint8_t)); |