diff mbox series

[FFmpeg-devel] lavc/tiff: Do not fail for an ICC profile with invalid type

Message ID CAB0OVGr9Z2QT8PGKF6yAN71rGCqbcTmyJdWE+iWMv+NoXuZjBQ@mail.gmail.com
State Superseded
Headers show
Series [FFmpeg-devel] lavc/tiff: Do not fail for an ICC profile with invalid type
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Carl Eugen Hoyos Sept. 5, 2020, 5:24 p.m. UTC
Hi!

Attached patch fixes ticket 8884.

Please comment, Carl Eugen
Subject: [PATCH] lavc/tiff: Do not fail for an ICC profile with invalid type.

Fixes ticket #8884.
---
 libavcodec/tiff.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Lynne Sept. 5, 2020, 7:22 p.m. UTC | #1
Sep 5, 2020, 18:24 by ceffmpeg@gmail.com:

> Hi!
>
> Attached patch fixes ticket 8884.
>
> Please comment, Carl Eugen
>

Just posted a patch which fixes the problem and allows parsing of such files instead.
Tested and works on #8884's samples.
diff mbox series

Patch

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 8a42e677ce..81e9a60bdf 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1682,8 +1682,10 @@  static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
         }
         break;
     case TIFF_ICC_PROFILE:
-        if (type != TIFF_UNDEFINED)
-            return AVERROR_INVALIDDATA;
+        if (type != TIFF_UNDEFINED) {
+            av_log(s->avctx, AV_LOG_WARNING, "Invalid ICC profile type %d\n", type);
+            break;
+        }
 
         gb_temp = s->gb;
         bytestream2_seek(&gb_temp, SEEK_SET, off);