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 5675146994 for ; Fri, 30 Jun 2023 00:17:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1697068C1AE; Fri, 30 Jun 2023 03:17:05 +0300 (EEST) Received: from mail-01-1.mymagenta.at (mail-01-1.mymagenta.at [80.109.253.246]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C1C2C687F3A for ; Fri, 30 Jun 2023 03:16:57 +0300 (EEST) Received: from [192.168.232.136] (helo=ren-mail-psmtp-mg02.) by mail-01.mymagenta.at with esmtp (Exim 4.93) (envelope-from ) id 1qF1om-0080ad-9G for ffmpeg-devel@ffmpeg.org; Fri, 30 Jun 2023 02:16:56 +0200 Received: from localhost ([84.115.40.24]) by ren-mail-psmtp-mg02. with ESMTP id F1ooqLNqTbZLDF1ooqymdK; Fri, 30 Jun 2023 02:16:58 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 84.115.40.24 X-CNFS-Analysis: v=2.4 cv=Ufwy9IeN c=1 sm=1 tr=0 ts=649e1efa a=4thelYDX6rwh+ygQwvsI+Q==:117 a=4thelYDX6rwh+ygQwvsI+Q==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=35311Wvmk_Gn3BQPaA4A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 30 Jun 2023 02:16:55 +0200 Message-Id: <20230630001655.10242-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230630001655.10242-1-michael@niedermayer.cc> References: <20230630001655.10242-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4xfIRLHMHZgknhsZr8zMu1yIIqWjpv8hNjJJOVG0qrFSgbnQAMaT/j0fERrf/g60GcrPdniWLy4dsAaB4RGVcpOEGMBBNtgPn6n/n7H5rFhhaVwG1Jgyah r+ds7m83vZ47X3LSZEcKlkboG+F8uwmln+tXue39VADigADzfWLpKIr+w0famOmLpOK7hypvMLed4w== Subject: [FFmpeg-devel] [PATCH 2/2] avformat/id3v2: Free buffer in decode_str() 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 MIME-Version: 1.0 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: Fixes: memleak Fixes: 60058/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5665259244093440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/id3v2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 38c86a8e79..69193933e0 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -309,8 +309,10 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding, avio_w8(dynbuf, 0); dynsize = avio_close_dyn_buf(dynbuf, dst); - if (dynsize <= 0) + if (dynsize <= 0) { + av_freep(dst); return AVERROR(ENOMEM); + } *maxread = left; return 0; -- 2.17.1 _______________________________________________ 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".