From patchwork Sat Sep 5 19:23:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 22124 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E41F344B761 for ; Sat, 5 Sep 2020 22:23:19 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C47EA68ADC4; Sat, 5 Sep 2020 22:23:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3438668064D for ; Sat, 5 Sep 2020 22:23:13 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id D4F8F106015B for ; Sat, 5 Sep 2020 19:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1599333792; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=F6nP3Uyb0QbeanBXabX7AlcmrQ4Wy7BO0RxJkfeXmKc=; b=3xJGsPhoYeWamdn5XyJ/MKq+BqLKfUbDvgb3zPCMm1Tmizik/MO3w5VkYzQBeYWD xblt22erPLyQiw6E3/0cIdNqeM7UeAbGysK2My1LwwA/ZSEXIznVJ9zmBcBxLneS4Mx b89ewY0fwjP8xFTsKExnbQ7/9Y5ZSXW+tu0MuVHHtbQzMWbnRpirzX+X65m/Siqp17q pw/wqaYULxoMrhBH/zcw+f/e5ebUhOAfe1NmqZ74+CQhVg5EYzJicTdjlB0d9eIgrf5 WZHcC5Sn5LA51BkrQ45z5gr2ig0fxQ4k1N1dcLiz1nuhfe4/7Yvd/uTJjD9TFGG57QG Lf01YfNY7g== Date: Sat, 5 Sep 2020 21:23:12 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] tiff: remove tiff type check for ICC profiles X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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. 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);