From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id A300F4BF89
	for <ffmpegdev@gitmailbox.com>; Tue,  1 Apr 2025 11:20:55 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1E0A687D03;
	Tue,  1 Apr 2025 14:20:49 +0300 (EEST)
Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com
 [209.85.208.46])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E6B8C687CB9
 for <ffmpeg-devel@ffmpeg.org>; Tue,  1 Apr 2025 14:20:42 +0300 (EEST)
Received: by mail-ed1-f46.google.com with SMTP id
 4fb4d7f45d1cf-5e5e34f4e89so10271083a12.1
 for <ffmpeg-devel@ffmpeg.org>; Tue, 01 Apr 2025 04:20:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1743506442; x=1744111242; darn=ffmpeg.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=1Xk7jaMjj0VBNPFYaJwXLO/3cxjAaf38qDoY1kIlh7k=;
 b=nk39O7GkX4b6lnXakqrdSqAYyGlnJ4ftQwyjQaXtLWqh/kS6k2b1y8Zg4Zj2Dsx5lK
 Is1sPhTEwLhUayJAZkCv0ZHQyc3TGZ1rcKk2jkHQ1dHZORXDw5EUN57Q1Zos29mR8HW2
 5lkA8X9R0kp2tsKMtiXKr6bhuagBjxqTqLB0Yc1pHkztcEQyizOz/MhKtL6GAOVQJtpd
 BoioJIDAePT0pSIVC251JZgxPiqVlJUUTmbXSAQlDiNI3J8Dc3cc1Zm5edm5wPpMB66D
 xEOXRsRyvvOR4zB7A6iGKl84HwWrB0bpd7TXRWtp7aDx060kPFWRm6IJzcUEO65hHHUv
 a89Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1743506442; x=1744111242;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=1Xk7jaMjj0VBNPFYaJwXLO/3cxjAaf38qDoY1kIlh7k=;
 b=IuXYeBYqluCR0+kboNRWlpuS9+FACHwoiRrkeH1ejjY7dIx/GJsw7H3oGn60ejIHeJ
 lFFkRcS/JbQUG2aoHQ8/f5qb78YBj+AQwouX7I7t29n//FaW+LfQv09lkUtXRB7iD5iD
 HoUGe22rrbT2MGiPveFHh6hmjhEmnr01p4+JB38HGEX97L0ivRbdPQCzBj+hrOw7/EMk
 viDTMvDU5fkFtAwJdjUH8wr5mvb5qLZ6W7yKw3lkwlZCdCqjTVjcrg4I77IeW0HpSi3t
 Arkh5hdjwzzFNI50w+bvLfVZUR8Kvw/aW8onfjA+I2wU6v9wB0PZxuEWonTjaRAyyjfd
 IGcQ==
X-Gm-Message-State: AOJu0YyreofJZp6DBIQtXHQlexJvCBR5Yxx+a9UMsSJ4/SiquBekKOpc
 CxQu4aSzNY6b1bEyQa0H3LLK0DZGdzYB1xELbVU2M4iJYo7Icw0REAvenw==
X-Gm-Gg: ASbGncux1vagzVvl7e38UWwGRIMHahTWWhYUqi0w9efAJxwTSRX4N70zPeAXonsR2lw
 GgteuwHI2PB3LOpq/FQ5aOgMND0sxyhSri63KxiM+3s4MRNy21OPQGdmO671qlHbigDTfrVetxT
 65kiW9ZO3Pn2zrWSxMRpyLLQKtVmxZKx3AT5WHh9d4QTz6CAhQC0ojgaKp787L/68hwhn1M1/5x
 xANnTWcjKNCNvDPGpoEUYm0O0sm8fUQqagnNMOptyN+3lBlzuxQpwcdEDrws79UM+VYfzwxDIxS
 UGVLJr1z0Mz/v+3omjuOHzfE2Icrj56x4D1F8988ByeZNyMp8sPrDNP+jpZ5IXEZKa/Cg4YZcVW
 aFUSFkn9I6v6D743FOCVykw==
X-Google-Smtp-Source: AGHT+IFMQ42EmHnVRTfWG+OTVaK9L2NcvR3afyxdPZMBz98qVYZWgyh/dURj4Qom2WNosn/ZY+eOnQ==
X-Received: by 2002:a05:6402:1e89:b0:5eb:1e0b:2bd with SMTP id
 4fb4d7f45d1cf-5edfcfcd2b9mr10180965a12.19.1743506441828; 
 Tue, 01 Apr 2025 04:20:41 -0700 (PDT)
Received: from localhost.localdomain (89-70-223-1.dynamic.chello.pl.
 [89.70.223.1]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5edc17e0042sm6930713a12.80.2025.04.01.04.20.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 01 Apr 2025 04:20:41 -0700 (PDT)
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Date: Tue,  1 Apr 2025 13:20:19 +0200
Message-ID: <20250401112019.237-1-kasper93@gmail.com>
X-Mailer: git-send-email 2.45.1
MIME-Version: 1.0
Subject: [FFmpeg-devel] [PATCH] tools/target_swr_fuzzer: fix memory leak on
 av_samples_fill_arrays() error
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250401112019.237-1-kasper93@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

---
 tools/target_swr_fuzzer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/target_swr_fuzzer.c b/tools/target_swr_fuzzer.c
index f154a11632..59fa24af64 100644
--- a/tools/target_swr_fuzzer.c
+++ b/tools/target_swr_fuzzer.c
@@ -79,7 +79,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     char out_layout_string[256];
     uint8_t * ain[SWR_CH_MAX];
     uint8_t *aout[SWR_CH_MAX];
-    uint8_t *out_data;
+    uint8_t *out_data = NULL;
     int in_sample_nb;
     int out_sample_nb = size;
     int count;
@@ -145,9 +145,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
 
     count = swr_convert(swr, aout, out_sample_nb, (const uint8_t **)ain, in_sample_nb);
 
-    av_freep(&out_data);
-
 end:
+    av_freep(&out_data);
     swr_free(&swr);
 
     return 0;
-- 
2.45.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".