From patchwork Tue Mar 15 14:28:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 34757 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp3065689nkb; Tue, 15 Mar 2022 07:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV4qa/UQj88vKjGtzWEK7kvueRKmUWOuX3zP/82MnN6plmiLH+qSu/lvcCaLK830HrG7qL X-Received: by 2002:aa7:ce1a:0:b0:416:460:9df5 with SMTP id d26-20020aa7ce1a000000b0041604609df5mr25054158edv.277.1647354546043; Tue, 15 Mar 2022 07:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647354546; cv=none; d=google.com; s=arc-20160816; b=mVa6xXM7BWPQY5S9EIIxkHQG0gQibvuYMyRUfEgnSz2tS9Fv4eIoK61qOmIzaGozAp Yf5PdCIZ3w2zAEcW2SRN0dhn9msFrEZInmeVDCMWB43a9WLCB9nKrIJ7/Lda3W/C7uUd xsDKBcCp4+YelS6uB3f6AOTnftjAqZ1d/aH4oh3lPP+19sivGMe/9cWZBp6NsdUsNVKe IxoSMPY1NmWTfbeJPTi6YbNik8yiy0Fss/tTBwrDOV4CCIrmqvXXowPTJL8LZEbz2MSa CsEKCdATE1ZHBRJIZbngRrtpSSm4NwVv2ZgM5eKDawHrn9BtyMM27FBNtY8lTXRV/YMj 7JxA== 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:message-id:date:to:from :delivered-to; bh=zQ3O3kLF9fOtIC//XI5nbTj1s2/M9wcNI59bQjhCnxA=; b=EW6dcJf8DH0h+0RNd0a70Rbih4GIUXDSmsGWV+XWjfYw2p804y8LRjWfCjPjxJxWn5 2SHA8KbUm1G94rg0wEDTkP7HitLz1vWWQt8Q8g5QN8SHKGh1EaO04F3rUNw1RANbCcN+ zVsCcnFhvnqdO5Fs/10ee9J3RccZWJazJzb3CXz/pDplmbNBZek/Ct4eaepUSctir8Ci cs0cMTo735jwh+kI4jylqPLm2qC6unOzClwyyT+XTdauNa+JD2imB5OXE30MyFV+pNHn +/bNPeCCY71RaSg3czehI5DTkG1wrPNlLQ17y0/15WlW4e+edclongWuvJ+c/whHGNsl gSDA== 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 j17-20020aa7ca51000000b004135251bb25si11213845edt.189.2022.03.15.07.29.05; Tue, 15 Mar 2022 07:29:05 -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 D8B606806E8; Tue, 15 Mar 2022 16:29:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 522BE680074 for ; Tue, 15 Mar 2022 16:28:55 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 741B3E5303; Tue, 15 Mar 2022 15:28:55 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RL9Av7IeJp96; Tue, 15 Mar 2022 15:28:54 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2B59BE12AE; Tue, 15 Mar 2022 15:28:54 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 15 Mar 2022 15:28:48 +0100 Message-Id: <20220315142848.30527-1-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JBwcs//6oWPV 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) {