From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 68BEB423D3 for ; Tue, 15 Mar 2022 15:10:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4061B68A7AD; Tue, 15 Mar 2022 17:10:46 +0200 (EET) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 539AA680297 for ; Tue, 15 Mar 2022 17:10:40 +0200 (EET) Received: by mail-ot1-f51.google.com with SMTP id g6-20020a9d6486000000b005acf9a0b644so14172413otl.12 for ; Tue, 15 Mar 2022 08:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=9XN0ZldTpE/rZ9SlGTJFLJu1aH37RQo8oiuQCnD651g=; b=mvVAU1g3UGursvrFQYaJriFLumuQAkQ9ggQfLp5wXhasM2l1PXpXf6q+Fy+LmKbbiB R2lOGlY7Mrcg3jqotkDg7+/yEeFY+kWoStvd0vaCOXBFfwgETW1mWNWGbszJd4MTLxEq VGTRfaLPJf4Fg0SrYtPQEesmzAYI7CHix8/SAn6Bsc5ZO9pDSf0Owyfc/B3cjC/7Ai0J tSFQL48lFq6N3gtzedxsI5VEMjLjG68o5p5pg/Sshd5RLlsze5cCyVl6vzDP4l6qi+sh CjnfExvPXplbq0FDZa9lG3ig1iCU8nIoJY//hGPPhISn/Bd/VmBAFtdOrmNPdRfsT427 FWCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=9XN0ZldTpE/rZ9SlGTJFLJu1aH37RQo8oiuQCnD651g=; b=t4VkTDbe3ycVMhkiBzbzEIQLH/1VYRCKnnE4XZI0qZB0HvYQaDn4eVAnr3i+xL8Spv mPqqwQM4tm+CORz58Sxu3BRaauYTovOO/xas5Eir3jBJq1bUVw7UDQFxxxTskRbusWqX noZAn7pcSEKYZZPUpj7mfyg7M/gSFcemcl8FjvCq/P/EX1kgRhe2fCkrFebebp8Z8L0/ vG+gagtfX566G7MzQCSXPcYeoCBc0Q5zcqT2ns4JNBEXF7ZDqgzOLQlAFsOQrOXCgnCL E1d2rK0f1MzZp0RSgildSXKFHeEgBxiYgxH11TP9CeYc7OfIwiaWrK1KW0LbnBTOW1AK uTig== X-Gm-Message-State: AOAM530WFKMOnvM1Jc3i8ip8poDTJ7auO99hJA9nYHCenkVVE++1ziSd PBbM/GDoFucmij3lxzXOrdoYqHckPr3mNA== X-Google-Smtp-Source: ABdhPJy4E8ZD5b72s45Dcv+1NDVaPAfxDkUluIjKRhHnYo1hDq1vxe73dpLLAMUHAuiUWVbY/rjPRg== X-Received: by 2002:a9d:4712:0:b0:5ad:f2a:6394 with SMTP id a18-20020a9d4712000000b005ad0f2a6394mr12877654otf.281.1647357038399; Tue, 15 Mar 2022 08:10:38 -0700 (PDT) Received: from [192.168.0.13] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id t15-20020a4aadcf000000b0031c33fdb5d9sm8901989oon.39.2022.03.15.08.10.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Mar 2022 08:10:37 -0700 (PDT) Message-ID: <63b43315-4bd0-f104-8ffc-a37f601b6c86@gmail.com> Date: Tue, 15 Mar 2022 12:10:36 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220315142848.30527-1-cus@passwd.hu> From: James Almer In-Reply-To: <20220315142848.30527-1-cus@passwd.hu> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/codec_par: do not copy AVChannelLayout struct directly 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/15/2022 11:28 AM, Marton Balint wrote: > Later we use av_channel_layout_copy, but that uninits the struct > unintentionally freeing the possibly allocated u.map pointer. > > Signed-off-by: Marton Balint > --- > libavcodec/codec_par.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c > index e4b329c838..abda649aa8 100644 > --- a/libavcodec/codec_par.c > +++ b/libavcodec/codec_par.c > @@ -78,6 +78,7 @@ int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src > codec_parameters_reset(dst); > memcpy(dst, src, sizeof(*dst)); > > + dst->ch_layout = (AVChannelLayout){0}; > dst->extradata = NULL; > dst->extradata_size = 0; > if (src->extradata) { LGTM. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".