Although the ICC specifications say to check for this, libtiff doesn't
and neither does any other TIFF implementation, and the TIFF specs
say that Photoshop has a different way to encapsulate ICC profiles,
and are asking for advice on how to deal with it.

So basically, photoshop puts a different type than what's specified,
no other implementation checks for this, we do because we tried to
follow the specs although its harmless to not, and ran into this bug
because we didn't know about it.

Patch attached.

>From fc08aa488c630740f0f7564db3ca39a797b66a8d Mon Sep 17 00:00:00 2001
From: Lynne <d...@lynne.ee>
Date: Sat, 5 Sep 2020 20:07:33 +0100
Subject: [PATCH] tiff: remove tiff type check for ICC profiles

Although the ICC specifications say to check for this, libtiff doesn't
and neither does any other TIFF implementation, and the TIFF specs
say that Photoshop has a different way to encapsulate ICC profiles,
and are asking for advice on how to deal with it.

So basically, photoshop puts a different type than what's specified,
no other implementation checks for this, we do because we tried to
follow the specs although its harmless to not, and ran into this bug
because we didn't know about it.
---
 libavcodec/tiff.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 08dbca9d60..451784da84 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1668,9 +1668,6 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
         }
         break;
     case TIFF_ICC_PROFILE:
-        if (type != TIFF_UNDEFINED)
-            return AVERROR_INVALIDDATA;
-
         gb_temp = s->gb;
         bytestream2_seek(&gb_temp, SEEK_SET, off);
 
-- 
2.28.0.297.g1956fa8f8d

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to