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 1A32D4A603 for ; Mon, 1 Apr 2024 20:56:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 911FF68D014; Mon, 1 Apr 2024 23:56:18 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFDD668CF98 for ; Mon, 1 Apr 2024 23:56:11 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 07C9540004 for ; Mon, 1 Apr 2024 20:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1712004971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=PRjK5KTNOWTbA0X0Hk0Wbh/XY4Q65AlWkL8sU0e8TTw=; b=OFbow7gE0w0HvR7vF8zgT3VBAx5Ueu7N2ekBOL24ItV8YbMFOR7lbtmhRjGRyx9AEcZvAY 3z2RkLxpo2foeXe5oxmWvuO8YZp0chrxqthVTC1c70lH72RH1PXyTCH5UDH3pwHMuXWa0h CKRiiAJ4CAbIXgh9UfWMb10Ea2VqokiYPt/miuUJ0OCwOVi8kptu/+OKyDAEb2RM5jA3oW 66hi4nOL/taerR0X5fCAU9MGpvWfXULJLQeDY3+tjADAXpSpeVmU+AOjCT5nf+zqT73QFK 1t9y3Oq4YI5AtykoNUWqCZMt0FeRa1iDshBLYleqd/HvqgZKgjjTycfpl1GPFg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 1 Apr 2024 22:56:05 +0200 Message-Id: <20240401205607.9093-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240401205607.9093-1-michael@niedermayer.cc> References: <20240401205607.9093-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/6] avformat/demux_utils: Avoid leaking the packet in ff_add_attached_pic() 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: 67714/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5671570999476224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/demux_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c index 86f551245be..96e6e20d1ec 100644 --- a/libavformat/demux_utils.c +++ b/libavformat/demux_utils.c @@ -123,9 +123,9 @@ int ff_add_attached_pic(AVFormatContext *s, AVStream *st0, AVIOContext *pb, if (!st && !(st = avformat_new_stream(s, NULL))) return AVERROR(ENOMEM); pkt = &st->attached_pic; + av_packet_unref(pkt); if (buf) { av_assert1(*buf); - av_packet_unref(pkt); pkt->buf = *buf; pkt->data = (*buf)->data; pkt->size = (*buf)->size - AV_INPUT_BUFFER_PADDING_SIZE; -- 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".