From 61e6eddc5735c0b981d868a17c0fb8fe9b2b8a88 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 15 Feb 2020 17:10:47 +0100 Subject: [PATCH] avcodec/tiff: Check for planar DNG images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DNG code hardcodes plane 0 at some places, so its better to disallow cases that have more planes. Fixes: eg_crash Found-by: 黄宁 Reviewed-by: Nick Renieris Signed-off-by: Michael Niedermayer --- libavcodec/tiff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 39f5234d60..176bfc274b 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1874,6 +1874,8 @@ again: bps = s->bpp / s->bppcount; if (bps < 8 || bps > 32) return AVERROR_INVALIDDATA; + if (s->planar) + return AVERROR_PATCHWELCOME; } if (!s->is_tiled && !s->strippos && !s->stripoff) {