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 48BBE4C94E for ; Sat, 10 Aug 2024 06:07:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D66E668D967; Sat, 10 Aug 2024 09:07:02 +0300 (EEST) Received: from mr85p00im-ztdg06011801.me.com (mr85p00im-ztdg06011801.me.com [17.58.23.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9559168D7F0 for ; Sat, 10 Aug 2024 09:06:56 +0300 (EEST) Received: from Yakumo-Yukari.lan (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-ztdg06011801.me.com (Postfix) with ESMTPSA id 0F4AF20B07DC; Sat, 10 Aug 2024 06:06:51 +0000 (UTC) To: ffmpeg-devel@ffmpeg.org Date: Sat, 10 Aug 2024 14:06:42 +0800 Message-Id: <20240810060642.58115-1-gnattuoc@me.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 X-Proofpoint-GUID: f-Pz_4nrQdvw7Mmnu8YlXUesj484pyJ6 X-Proofpoint-ORIG-GUID: f-Pz_4nrQdvw7Mmnu8YlXUesj484pyJ6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-10_05,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=814 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2408100045 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 Subject: [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: always release supported_props 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: , From: gnattu via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: gnattu 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: In vtenc_populate_extradata, supported_props should always be released to avoid memory leak. Regression from cd2f8a22e94700c68b1de7968df11e8bebfd315b Signed-off-by: gnattu --- libavcodec/videotoolboxenc.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 78ef474d7ae..6cc45db4a96 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -2787,9 +2787,16 @@ pe_cleanup: if (status) { vtenc_reset(vtctx); - } else if (vtctx->session) { - CFRelease(vtctx->session); - vtctx->session = NULL; + } else { + if (vtctx->session) { + CFRelease(vtctx->session); + vtctx->session = NULL; + } + + if (vtctx->supported_props) { + CFRelease(vtctx->supported_props); + vtctx->supported_props = NULL; + } } vtctx->frame_ct_out = 0; -- 2.39.3 (Apple Git-146) _______________________________________________ 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".