From patchwork Sun May 14 21:37:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Beauxis X-Patchwork-Id: 41606 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp1171588pzb; Sun, 14 May 2023 14:43:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Xw3UU5z92GxTHVmQjJ8thKO21sStahOB3OG2b0FvrY+96W99F6ffpJJD3ppw7zvSdA9f+ X-Received: by 2002:a17:907:7dab:b0:96a:4f89:3916 with SMTP id oz43-20020a1709077dab00b0096a4f893916mr11822142ejc.58.1684100583405; Sun, 14 May 2023 14:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684100583; cv=none; d=google.com; s=arc-20160816; b=PuzeZR/UxnfYZfiAexuXeEvS6NFRwx53wyRg4/CSb5Tj2KOMGYLexEKAL/CXb/k5nx VpaLsJco+ZRe2hRt+nBdDXKwNjTarwq4db59qwkn19TYpkf/KCHlY8VBYRKcW66VGeWN +q88kalz/3JbhkNjuqv0Zvix30hi9gvnhAJDGsRXfMXPCNoOW5Dbhzbn0Cjmt8a6BN1v do8JHXKwtCz//6V/3+k53njUaNj+rVh5tS4JazPNsSwNxlbn+2kY9R1MUr7EQrwoSkY6 Dq9Q8gPJ7aGOkyoWzzAekycATv/cy2dC5tkqumnOyw0qiHZBf7zNGsZGNift226Olyq1 +slQ== 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:delivered-to; bh=8qkBBGmbnzgDHYh2T9MuUoNijipAyJBSiDhLw7Nge9c=; b=WioVRshMm2SdinLTCJ5wo7uiCqLkwHdypbXzBPdowBv/yI/byJyLNWCujgJsjvyIb/ a5ZxTorf6ULMdfhVUo83KZLIyoj4WAN0axW6a8OyOl1bFOYnWB/HarF1pzpoFBHYEWXZ J9zaFUgZIherE8eaNDILEb+B3iVrXFYED+tCnYMaefaDopU7bE8aP/rg2KzVSe6NT3NU 9CMTF5PWMKmbdhfOmSUQW6tjj1IIuMzxooS8h5lPcas+dCPY3yvo9etf7Xwd1upIpSFZ QY12dEnuGe6FOn2ldKIw5B8SF1Fm1TLjtyv+UCzd/r33BId2F8gDnNaq5NXM4/G/0SJC bMwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 q12-20020a1709060e4c00b0094f67fc03d4si11447332eji.991.2023.05.14.14.43.02; Sun, 14 May 2023 14:43:03 -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; 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 6E37A68BF8F; Mon, 15 May 2023 00:42:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67403689BA9 for ; Mon, 15 May 2023 00:42:53 +0300 (EEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ab125a198dso18997085ad.1 for ; Sun, 14 May 2023 14:42:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684100571; x=1686692571; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=77yWsPYUsmrq3rD2RuvBfzmA0KvRImvopiarW+sTUGs=; b=gpSaKFUoGNBeNogejtCdZVV1n/JYLcOQsmVR069yy4EvrMncTMUhYtDoe3vEQ4Htzs SaedMh5+DdhDD0DU9xgKTKUUYHNqTlKKC2az+WmOPxSAQmqdY84j6t6tUZxa6VUN8Dhh pS/qtjIys8+lAP66niGVpRjMFiKS38StU4/tLUi7gMCMnao5p6mNkSl3IK1yWfy2Rj2q spKZO0XfiadYdx/wxKwd0iCpenCjKD10BBJWx1eOcQHdBFfui/r0olcWfFL7CMrIgTjq qdmBUBm0YcHwy+R1nFapSqeYHze07KddH0glvn7WjM6JeNyUUwCG2h1dGb0hJ6CgcCRl 3X6A== X-Gm-Message-State: AC+VfDwtI1QImsd4hYi0eI7Jac4+//30L3BDA7aJOpQwVT+NzgxvykZx RKWpOFM3wE2IQiVx7jSsnZJtDoWRwUE= X-Received: by 2002:a17:903:41ca:b0:1a4:f4e6:b68 with SMTP id u10-20020a17090341ca00b001a4f4e60b68mr39692670ple.3.1684100571275; Sun, 14 May 2023 14:42:51 -0700 (PDT) Received: from localhost.localdomain (066-168-152-244.res.spectrum.com. [66.168.152.244]) by smtp.gmail.com with ESMTPSA id jl1-20020a170903134100b001a4edbabad3sm1346808plb.230.2023.05.14.14.42.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 14 May 2023 14:42:50 -0700 (PDT) From: toots@rastageeks.org To: ffmpeg-devel@ffmpeg.org Date: Sun, 14 May 2023 16:37:43 -0500 Message-Id: <20230514213741.34312-2-toots@rastageeks.org> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230514213741.34312-1-toots@rastageeks.org> References: <20230514213741.34312-1-toots@rastageeks.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 2/2] libavformat/oggparseopus: Clear existing stream metadata before parsing potentially new one. Fixes: #10363 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: Romain Beauxis Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZpcJktMGV43B From: Romain Beauxis This is the third version of a series of patches improving metadata support in chained ogg streams. Previous versions of this patch were including changes that were later identified as issues from another encoded and fixed there. See: https://github.com/savonet/liquidsoap/pull/3062 The remaining changes address a memory leak in chained ogg/opus stream metadata. Reproduction steps for the issue are detailed in: https://trac.ffmpeg.org/ticket/10363 --- libavformat/oggparseopus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c index 54aa725be6..86977b41db 100644 --- a/libavformat/oggparseopus.c +++ b/libavformat/oggparseopus.c @@ -80,6 +80,7 @@ static int opus_header(AVFormatContext *avf, int idx) if (priv->need_comments) { if (os->psize < 8 || memcmp(packet, "OpusTags", 8)) return AVERROR_INVALIDDATA; + av_dict_free(&st->metadata); ff_vorbis_stream_comment(avf, st, packet + 8, os->psize - 8); priv->need_comments--; return 1;