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 2C1A74593E for ; Mon, 29 May 2023 00:22:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7FC6D68C20C; Mon, 29 May 2023 03:22:41 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7988368C1C3 for ; Mon, 29 May 2023 03:22:35 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 2CC5110601EF for ; Mon, 29 May 2023 00:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685319754; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=1qA/qK36Srj/j3sOnLrf1v3HDL6/scSHQuiqgoWHKXM=; b=4DofG/RpZI68kzOXSQgnBeOUREWg2d37JkVjC94N19TjLuCj+tcnd0UG2pMKw54g +Bj3OYhMRHTuiQtUbifNlSTHR+tWZ+dHyTFvV7l7MSajQ2ymvYN+BKPGGg+z9L/I7AF mTk4zFNkB4KATaKV5lOzIDqjQGK+JJ2RS4Ao7zf079CN6Idk5P2kjpkAb+zVvGubGAQ NIM1xr2uyu6Ml5VquL1I6o9zh+FHm22EOlxIXokH16db/6+lCjPppEd1988to/pESk1 11wNI8icYz87qiHF3xntoGkVt7Q3HPB5+c2Ny6elhxUkYTYoM1tV+y6l2KFeQrXDls6 W9FN2CW5/g== Date: Mon, 29 May 2023 02:22:34 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_105115_1467863001.1685319754530" Subject: [FFmpeg-devel] [PATCH] vulkan_decode: check if yuv_sampler exists before freeing it 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: ------=_Part_105115_1467863001.1685319754530 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit No Vulkan function is NULL-safe, for no real reason, despite the language defining and returning VK_NULL_HANDLE. Patch attached. ------=_Part_105115_1467863001.1685319754530 Content-Type: text/x-diff; charset=us-ascii; name=0001-vulkan_decode-check-if-yuv_sampler-exists-before-fre.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-vulkan_decode-check-if-yuv_sampler-exists-before-fre.patch >From 60f73541330ae33f92b862250e7f3c928394c0b9 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 29 May 2023 02:04:59 +0200 Subject: [PATCH] vulkan_decode: check if yuv_sampler exists before freeing it No Vulkan function is NULL-safe, for no real reason, despite the language defining and returning VK_NULL_HANDLE. --- libavcodec/vulkan_decode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index 1d1fb9ad97..6138106fef 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -581,8 +581,9 @@ static void free_common(void *opaque, uint8_t *data) ff_vk_video_common_uninit(s, &ctx->common); - vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, ctx->yuv_sampler, - s->hwctx->alloc); + if (ctx->yuv_sampler) + vk->DestroySamplerYcbcrConversion(s->hwctx->act_dev, ctx->yuv_sampler, + s->hwctx->alloc); ff_vk_uninit(s); } -- 2.40.1 ------=_Part_105115_1467863001.1685319754530 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". ------=_Part_105115_1467863001.1685319754530--