From patchwork Fri Feb 23 13:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 46485 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:26a3:b0:19e:cdac:8cce with SMTP id h35csp994606pze; Fri, 23 Feb 2024 06:35:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVCZxveM/9xfu3pSLvXkAt06iip+d6jFiT8icDg+jZspCQT0yX24sTglO8+OS4AHvnc15R8Z8kIO1mP+IOV99ggS/v+l4ZbbmuJvA== X-Google-Smtp-Source: AGHT+IEJfXLs5MlQI0KNDqcrOwdEmBCyy8QsyxMjHu6w/Z9XTXZV7IzSJnxzT5fvgmUV2qKs3Ojf X-Received: by 2002:a05:6402:1a5c:b0:565:874:8534 with SMTP id bf28-20020a0564021a5c00b0056508748534mr282edb.29.1708698948037; Fri, 23 Feb 2024 06:35:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708698948; cv=none; d=google.com; s=arc-20160816; b=iQYE/81WN/j2TeDvpjQRQbSKhVZG1/GSXYN2/4FI2GTn36Stj6t+p4EPcdyl3xXlzp Wc1e4jl22vSOFLGPJGdSYo23Mt4n8HRaSeEEoyrem5maqOhvj7g8tWDHRs0cZ+L9zHPx qr5O85xPJDTDOCb47VRFCXmED9MtAkldXWNJLdPtY4LiNJwVlaU18gopUGyxyyMFzpkU 4odJvG6y6y7l9HghJ3x71yIiZdk2S5Xbzly9KT3ZkWdojdz64XlmWjtjyO7W1FYqD1Fc VCBwRvo/x1gVNRnOqW1MYS95sk6Ybf/F+wF/bX8SaJ6LwV68KBJ6af29R6nbsWs1eain 0e/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=6wpQafBfvwDQb6dXW8v/nfUA69Jcih4WKOo1k8xEJ/g=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=wTDjCWsITLgXWdquSpOLHE8g38K/To5qndI3TUYcmCiKzkfe6mSeU8TCnKxJPqpGNa SB5esE4E+buiLLeeFaxlsa+sqnosJZyIzpqVlibKhd/JSlxEaLIe8q4x0CalI2prWKOl nyWVRjXd8PO6CMU++3roUlSIAuX3r5ghYE9G/LD1b4LTr0hGgcU8z7PxTll9nj66hN2H u9wdobi+cTsA91xnqZZIWaPSoHASuj4Jyrom2vI3ScwU5p2k4bUjwzZ+gMyVMoI0N0fS xmVvJq26yBkRl2Tqs3exOYVd9zsSrQJ1D1Z5fmTqV9jxm6j2140oyS2QoMDiWijsV2D1 QIzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=U4ozdRpg; 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 a59-20020a509ec1000000b005638bb1c69csi6357399edf.374.2024.02.23.06.35.47; Fri, 23 Feb 2024 06:35:48 -0800 (PST) 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=@khirnov.net header.s=mail header.b=U4ozdRpg; 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 B82EF68C737; Fri, 23 Feb 2024 16:32:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4304468C6E0 for ; Fri, 23 Feb 2024 16:31:36 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=U4ozdRpg; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1FB3F4D03 for ; Fri, 23 Feb 2024 15:31:36 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id W2Fj38g-tsyl for ; Fri, 23 Feb 2024 15:31:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1708698689; bh=TPDkFm7eU9JkbN2tmYNO7xKd+n0ylzOPrqRx2OcyZzg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=U4ozdRpg8BR7s0acCYyKxzr9Gju2Q3FTvOCMENVgos3sGYXdcR+/X7Wp053lNDlzb 8y+D0bhIdM6eqi7jtXQtFF8sqC2GCIGcmbfYXRlVIqAg1+spZmfLzPF5oFqjNnL4fl YBLXLvqsAQorL1MVlltkg6BP7i/hlg5MLfQZIY830QezzehWo8+5mlKeofMGhJ9StR m0W76KFqikpuXjKK+WcpeZyuHvq4XyK0DtUyySxXgFYt3b3dQ2o94J/C+iZmnjYRTe 2zg2IwmcZt6sVaoeNN2Isr5F2mwkuJwwVw7jedRo8jglg5lcnDYcWkkKz59Pm6dqFD Q86KWZbpF2Z2A== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id D57144D58 for ; Fri, 23 Feb 2024 15:31:27 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 255C83A25D4 for ; Fri, 23 Feb 2024 15:31:23 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Feb 2024 14:58:50 +0100 Message-ID: <20240223143115.16521-29-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223143115.16521-1-anton@khirnov.net> References: <20240223143115.16521-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 28/38] avcodec/tiff: respect side data preference 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: VU1p6LyDicnv From: Niklas Haas --- libavcodec/tiff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 71cb703821..cb4d378753 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1706,11 +1706,11 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) if (bytestream2_get_bytes_left(&gb_temp) < count) return AVERROR_INVALIDDATA; - sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, count); - if (!sd) - return AVERROR(ENOMEM); - - bytestream2_get_bufferu(&gb_temp, sd->data, count); + ret = ff_frame_new_side_data(s->avctx, frame, AV_FRAME_DATA_ICC_PROFILE, count, &sd); + if (ret < 0) + return ret; + if (sd) + bytestream2_get_bufferu(&gb_temp, sd->data, count); break; case TIFF_ARTIST: ADD_METADATA(count, "artist", NULL);