From patchwork Wed Sep 27 10:03:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 43976 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:2a18:b0:15d:8365:d4b8 with SMTP id e24csp2493867pzh; Wed, 27 Sep 2023 03:07:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPvQby+q9bq/W+HjEH7XmtQcF9UZ7JGVWSnUcx4kWrqYXN/NzlOZ34Y0Jn9vzhT4FQoTME X-Received: by 2002:a17:906:99c7:b0:9b2:a783:3d0 with SMTP id s7-20020a17090699c700b009b2a78303d0mr4928330ejn.37.1695809258971; Wed, 27 Sep 2023 03:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695809258; cv=none; d=google.com; s=arc-20160816; b=pcQOyy6zo+NHP/ErlSN9gotOOz5TSYvP3Lq9l8PaGn9yITj9h3/MNQHTUHlbEmIilq 5uhTg9FfWOwnYvDsnu1k5OFAg13zYTBl1sGofqc4zQv30n9+mZoweCY6y3fXv1AP8+6a UWAz1h7TUFQx/+uMjZ1hW2roG172YlxVF21BJOhUX8m3b7NCOaUTdYEyhie84wUNlzey +pO2sUSflvblHNEHAKrn6XKlNLlhVhP7ICxIQ/7HeoxilUAgrcDtCwWxOP1U3UBZWkGu 5F7m5K2qsMyqn4Gs3Cmcj+/FuWqQ7cl2nci8YJDf/RQRZ9RN79DKTyZV83CZN4GhGRRe iWKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=qCATyj8GcQ+HFjZFrvfWNcRxUYxwlaiv53EfPNrEwik=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=A6/3ElhwA02Kg0dyuwXNVq11D/Cp2Mydl2iyJDG/kgoe9F3U1VP4SIxKqzNaGQ7x0Q M2nTTUXglbPPLRjOK024NYnsb19Vl8FKFhjomTOF0uq3MqOir0nh9fLpenF5E/KEWjMh wqhs4rSYWgNdh5HonGA0Gw5AT8XTJhFS7+ICr8y4gK46NnJwo5C61cR/EOEQs3p9NgqW 8tU3U+3/oCkkFDw/ZaO0CsGCDrlbh7/HX2PHhdNK68kQh5UR5FGnJzOLz01NQjDv0PVI IgZg+YPNl/C4BVgE/DNRtfdxWthH88hRgDReNkn7//vv2m9fNlREMn0ZeQU5pM2DUUDl MIkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=OyeXsJo8; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l6-20020a170906a40600b0099cc50f304csi14214333ejz.291.2023.09.27.03.07.38; Wed, 27 Sep 2023 03:07:38 -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=@haasn.xyz header.s=mail header.b=OyeXsJo8; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 95E8068CAF3; Wed, 27 Sep 2023 13:06:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E64768CAE9 for ; Wed, 27 Sep 2023 13:06:45 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 23D7F4B9D1; Wed, 27 Sep 2023 12:06:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1695809201; bh=xYGIxu1nb9iUxBrPDglbb37NKRlHV8Cub7Wf/fge4oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OyeXsJo8UdYxuBhTqA7EGaS82RWUDlLxJF62Ws4DdyhEUerhhDafnuRyOssyfjy2/ HIcBcYU2CpcDQKRcfzfuIkvWqPuUsxzg5kEKb+B0yaeuDnJ7TRTSHX7O4c7a+VIWmF i7voOuH6zOBBs5CpK8ywtgdvx5mPLhIhk7PiC8lY= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Sep 2023 12:03:56 +0200 Message-ID: <20230927100630.50510-6-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927100630.50510-1-ffmpeg@haasn.xyz> References: <20230927100630.50510-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/decode: use ff_icc_profile_sanitize 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 Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: os1qGPsBi19s From: Niklas Haas Fixes: https://trac.ffmpeg.org/ticket/9673 --- libavcodec/decode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 466c393c1e2..6f4ef7da0c2 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -536,7 +536,9 @@ static int detect_colorspace(AVCodecContext *avctx, AVFrame *frame) if (!profile) return AVERROR_INVALIDDATA; - ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); + ret = ff_icc_profile_sanitize(&avci->icc, profile); + if (!ret) + ret = ff_icc_profile_read_primaries(&avci->icc, profile, &coeffs); if (!ret) ret = ff_icc_profile_detect_transfer(&avci->icc, profile, &trc); cmsCloseProfile(profile);