]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/tiff: Check for planar DNG images
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 15 Feb 2020 16:10:47 +0000 (17:10 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 29 Apr 2020 21:42:37 +0000 (23:42 +0200)
The DNG code hardcodes plane 0 at some places, so its better to disallow cases
that have more planes.

Fixes: eg_crash
Found-by: 黄宁 <tsukimurarin@163.com>
Reviewed-by: Nick Renieris <velocityra@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/tiff.c

index 39f5234d60248ab3a92b15acf3e0b8e216cff544..176bfc274b976992a8960e7aadf86eb9e2e4d0e9 100644 (file)
@@ -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) {