From patchwork Mon Sep 14 05:27:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22360 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E46494480DE for ; Mon, 14 Sep 2020 08:34:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB70968BC2A; Mon, 14 Sep 2020 08:34:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEABC68BBA1 for ; Mon, 14 Sep 2020 08:34:24 +0300 (EEST) Received: by mail-lf1-f65.google.com with SMTP id z19so12013326lfr.4 for ; Sun, 13 Sep 2020 22:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MjGHfXYiPPHfxBUwQEWGgidokQv8dXr6Lqixc7cWHAY=; b=sHEN8gdgU2GdWNB7FGy9yFQ0Il8B/0Kbs6q3NlEkt4xF34XMUarbLny6YYEKrXn07H UU3h7CL1DbGDc8MYUSSCDsl51nfucyTBe+5naRj0CYhWmW52tn5HVYNwQUAqLZYAboh9 5YdGSRxyyatNfY01TeXN3IEJItUXY9ZxX/civFcONcjk+7xaH65ksCINbud3pXa8Pfal 224hj9KIPszil7/LhLl8B5/dovFtLhdU7tqccg/GYMV0JcM+i4FdZb3PCbwF5cwcuIzX x5arXc5nT04rMUNyfyn3/cx4b1+VN8XKQacN8aTOsUXt70MMbMkaMvEyr2AVMB4UQHi3 HVkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MjGHfXYiPPHfxBUwQEWGgidokQv8dXr6Lqixc7cWHAY=; b=GoMvYyxo4jlZwLD6sZGDJXYGVTforCw1LjN1aumJGmkTz1ms6HZLGAsCjUT9FcYg8w QUx1C2JvjrvcfZUidZytmaEfaxmhGLyv91RfobpNafsdHzPwv7xUBmK2COSSITY1ZwaU NYOj7jLTOlhWaEQmzY0YtVEP+hbYQ/Zevnzsct5gJqOINUg413E1lVSbwnP2igYKl+oY +CdyZgVaja9V4CpR30lGmkPb4fIqX3L6V6N1D/mY2lM63qnluYDNJtoumsCLSNYnOiAp l/TdFTAw9gTBtA0lAR8dAvmzK6onzuO1kwZw5XSCnYYC3G8ltpQxaeTVa2yrazvvV90w KX2Q== X-Gm-Message-State: AOAM531UE3K+j1y0WBYo+nbXoZKXtp+IM1QUpihGkaFTsSu1B8mWkwif fhO+x0lqNMeIheCgB7QW7nvWXfXCCvA= X-Google-Smtp-Source: ABdhPJzMXF89AXFejYGo7tTt6nXSqG/cRzJmMbtrs2IW2Od7b19u5GpPsDcrpG0Cu5AR3aubQ5pdiw== X-Received: by 2002:a17:906:b74a:: with SMTP id fx10mr12707431ejb.232.1600061308619; Sun, 13 Sep 2020 22:28:28 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id f4sm8251421edm.76.2020.09.13.22.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 22:28:28 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Sep 2020 07:27:37 +0200 Message-Id: <20200914052747.124118-14-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200913025753.274772-1-andreas.rheinhardt@gmail.com> References: <20200913025753.274772-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 30/40] avcodec/cngenc: Replace av_free() by av_freep() in close function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This avoids leaving pointers to already freed memory in memory. Signed-off-by: Andreas Rheinhardt --- libavcodec/cngenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c index e185c4a40a..8f23b7555a 100644 --- a/libavcodec/cngenc.c +++ b/libavcodec/cngenc.c @@ -37,8 +37,8 @@ static av_cold int cng_encode_close(AVCodecContext *avctx) { CNGContext *p = avctx->priv_data; ff_lpc_end(&p->lpc); - av_free(p->samples32); - av_free(p->ref_coef); + av_freep(&p->samples32); + av_freep(&p->ref_coef); return 0; }