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 67224481F1 for ; Sun, 12 Nov 2023 17:46:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6747468CC8F; Sun, 12 Nov 2023 19:46:36 +0200 (EET) Received: from alphacentauri.ramacher.at (alphacentauri.ramacher.at [195.201.139.148]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A55E068CC6F for ; Sun, 12 Nov 2023 19:46:29 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ramacher.at ; s=mail; h=MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To: From:Cc:Content-Type; bh=iIn7inq5fggcWU0yAfFv984i9D+8nwrpvFDAkk8PsCo=; b=YRrG pKf7Va4uSfh+iJDVblgreGe0TkVVcAb83u5fgeeA2WU5ICInuvcQAv0iPZBW0rNfOuREN9xqK+XE7 0KxoBg6HjncbVyNGMTTHrIssqVarrLvnHlSq/M3WzlxP8ZhUmx214eH2PCpez71O+eTRZWsZk9hmu WMiyY69ur1h68=; From: Sebastian Ramacher To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Nov 2023 18:46:27 +0100 Message-ID: <20231112174628.2701654-1-sramacher@debian.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231112151144.2307049-1-sramacher@debian.org> References: <20231112151144.2307049-1-sramacher@debian.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCHv2 1/2] avcodec/fft: Use av_mallocz to avoid invalid free/uninit 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavcodec/avfft.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index fb635abfff..3ef076d222 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -46,7 +46,7 @@ FFTContext *av_fft_init(int nbits, int inverse) { int ret; float scale = 1.0f; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -85,7 +85,7 @@ FFTContext *av_mdct_init(int nbits, int inverse, double scale) { int ret; float scale_f = scale; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -146,7 +146,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) if (trans != IDFT_C2R && trans != DFT_R2C) return NULL; - s = av_malloc(sizeof(*s)); + s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -199,7 +199,7 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) [DST_I] = AV_TX_FLOAT_DST_I, }; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; -- 2.42.0 _______________________________________________ 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".