From patchwork Sun Oct 2 18:32:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 38523 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp912562pzh; Sun, 2 Oct 2022 11:32:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aHP8ucK562M1oFlMb9AxmnF0qjqaLjNV+KybjHiBIWBfoeWBv7yiyk1cBaP/4dLNlT674 X-Received: by 2002:a17:906:9b83:b0:730:b3ae:343 with SMTP id dd3-20020a1709069b8300b00730b3ae0343mr13466264ejc.670.1664735551017; Sun, 02 Oct 2022 11:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664735551; cv=none; d=google.com; s=arc-20160816; b=KhKpsfHC35RFdgixIwBJqE7kVFjLdDwtoHdgETGm6D+2jr9dL5EaXj3+jVwKHwHZwo fVqPE3ol6uAtjW8rlsPJMDtwnqpClP0X+6MaTn+9fA8STRZ6/xG+JY8/fngwZOghtG1D 9ExItZ3EvvRu12j5VwnXLV8j20SwpZxG+xvrL+LCzvkLH2355ebp3YlL5kzrI5oCIOjL HMcbUQRitxliTv9VBm4jz88eqLY9YGhs+gXpgZzEGJsxMsamfXXbW+uZN1u5xaG+7pas T/816ZRNNHfF7cqGHuiXJf6Rg7vEHSk3ZYH4raI51z/fdIUE5h9DD89syTQ//qIhW5MQ Hx/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=FwKu5BqE4zB98GqQfcZbAKPhV3HJaK87QEPcY6ZN4r0=; b=cjXvc8Q0NfBqPZ1bZ/JmKsHCY2RQJJB8ABjT71Ne5/p3l8l1iInzl8A2mTxpiV7afX hH8hzXWLeUv344dKaOdI3TyZmNbuI4ZebYHLVZFzWkwDxUTj8MQNSR5jXnUWd47+4RuS Jwtcif2ojzQMSi7hzbvjqbyDeu83ZBI5hbBpVIIj1Shgw/3q7MyXALE8j5jIMzdEEy6v wiw169/koD4t6JAj+TsqObtSOSbxf0J/pugYFnuqxJwtR/e9Zq3BMr+t8lx3z/M+uWJl 918wMEVk48xZcqzEu7TTLi9FJhc1PS4pRd+jQs8lcw+ryd5avnjdQLbxDD5Ea/T6xpQJ kp0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=qN3r4wj6; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qb15-20020a1709077e8f00b0076210372a3bsi5815763ejc.333.2022.10.02.11.32.30; Sun, 02 Oct 2022 11:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=qN3r4wj6; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8A1368BBAA; Sun, 2 Oct 2022 21:32:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD88468BBED for ; Sun, 2 Oct 2022 21:32:20 +0300 (EEST) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-3573ed7cc15so44167447b3.1 for ; Sun, 02 Oct 2022 11:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=HXLmskH0fklOFKn5ibdfFS6WXeBPOb3K1+Lm5ZBEGlM=; b=qN3r4wj6aicoX88MIGFyvAAs2G+B8wPKlryHJg+6kVauEqUdiLO8TptRLesRiLweiU JKUMWvwkzwpz3s1nVsTHm0Ai65Y6pczm2Vs1RxwleoFKapkKvntZ3RRfnaLWdb8P1med RPjrkFOy2DHULbYmAneO17XylfYtZn4VupJc9K/T6UCm0OabhOiloEtYuREGuUkogH0Y Nqm6b7yVd6TwdusQEljl6Ds0hLPxqRRdQDxDIE6FgDbUL8y63UALxyv461Iw4PhwKXlc cwqNuWQfeDHDwDyNnXbhmfM0FktqaoauUFILyg1fTtLsXbEAUSpr49m1lGHOx8S1yOxO RJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=HXLmskH0fklOFKn5ibdfFS6WXeBPOb3K1+Lm5ZBEGlM=; b=Zuv7LIi6OSut9oxEDaNZ4c7V+bqvF+T/boAr/GS7mjt5/sTe65rGIh9pbWhWUgB4G4 ABDVQZUkRT1pigPsz13uS/NkYr7PDaYsMC1CT4Xn2HFmu2QwScTAomMuUZUlHy8ezgpD XBS/d8dT3OdnCZQYE5t7kCjQgGBijl8J7+3O25GjX83NpMPyv9vPxt7EA0+IP0Xek7f6 jUYyQoEoNG24t5h2Gg21gpRLK8CfSZrxtBA03bWBdFz1gAY5Wj95+ZVQN6bXQdf6RdOw 1gczMdmhpZaXk58cX+vOAMuBoCt2uEUfz6gm8FZtv8faP9gtZOGZyVY8yJ4qRRsodh7x bVfg== X-Gm-Message-State: ACrzQf0ky4PFPOQ0gmBqaNWDM3wrseUZ1qGlpkCCciPfVAW6Kp3lwbmW 9kDWDCUy2ld0I7M/TZHaxZssTvsseEJHth6XXIu/RpNj X-Received: by 2002:a81:b01:0:b0:354:bbb5:cb08 with SMTP id 1-20020a810b01000000b00354bbb5cb08mr17066187ywl.34.1664735539414; Sun, 02 Oct 2022 11:32:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a81:928d:0:0:0:0:0 with HTTP; Sun, 2 Oct 2022 11:32:18 -0700 (PDT) From: Paul B Mahol Date: Sun, 2 Oct 2022 20:32:18 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] tiff: add support for one more tag X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: JxRJGh3RTkdE Patch attached. From c3dc0b0bf8fe84692ae0c877c6f33880ad7992c5 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 2 Oct 2022 20:32:34 +0200 Subject: [PATCH] avcodec/tiff: add support for one more tag Also be less strict about tag order. Signed-off-by: Paul B Mahol --- libavcodec/tiff.c | 9 +++++++-- libavcodec/tiff.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index fd9db18c0b..0a8df6a788 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1264,7 +1264,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) if (ret < 0) { goto end; } - if (tag <= s->last_tag) + if (s->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT && tag <= s->last_tag) return AVERROR_INVALIDDATA; // We ignore TIFF_STRIP_SIZE as it is sometimes in the logic but wrong order around TIFF_STRIP_OFFS @@ -1783,7 +1783,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) } break; case DNG_AS_SHOT_NEUTRAL: - if (type != TIFF_RATIONAL) + if (type != TIFF_RATIONAL && + type != TIFF_SHORT) break; for (int i = 0; i < 3; i++) { @@ -1845,6 +1846,10 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) } } break; + case DNG_PRIVATE_DATA: + for (int i = 0; i < count; i++) + ff_tget(&s->gb, type, s->le); + break; case CINEMADNG_TIME_CODES: case CINEMADNG_FRAME_RATE: case CINEMADNG_T_STOP: diff --git a/libavcodec/tiff.h b/libavcodec/tiff.h index e67c59abad..e491d8ea28 100644 --- a/libavcodec/tiff.h +++ b/libavcodec/tiff.h @@ -113,6 +113,7 @@ enum DngTags { DNG_ANALOG_BALANCE = 0xC627, DNG_AS_SHOT_NEUTRAL = 0xC628, DNG_AS_SHOT_WHITE_XY = 0xC629, + DNG_PRIVATE_DATA = 0xC634, }; /** list of CinemaDNG tags */ -- 2.37.2