From patchwork Mon May 29 00:22:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 41876 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp1372257pzb; Sun, 28 May 2023 17:22:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GsiRHlmBGpFfq9vXUoXgo8JQtpN84sMx9AbDMBVBdtMPHVX586qtLATftrcMA3e3eqlVm X-Received: by 2002:a17:907:3f03:b0:971:2ead:e161 with SMTP id hq3-20020a1709073f0300b009712eade161mr9991076ejc.6.1685319766472; Sun, 28 May 2023 17:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685319766; cv=none; d=google.com; s=arc-20160816; b=k9CMsTelbsB0yzLq0Tc3U4g5Fx0ks+RNtxieLeDpAXzVZetJShBnA/Uhl+TJTq6LmO 1brgUoj+jxeYLzHp44GWlLsu4sNWyqbzZ/MIFMssYMfzMxnwHvSfAhGGAywAXzo88Umq QHUVU0n5DwsL/hdJZAO9fk3mJWM4DLwO/TVLQXpaU4pzR/b4mvLjgZUIq4bNzd0uo/AM LDFobLi/JRM8uRQIEbB0A30OKkF5NhQZ/P/SJhOh0ABfqtschSbesVZMBsGBe+bQMxDG 2bwvGUsyDBIx863f0s1Tsk5FNsEcwtvfsATFcgGzVXdOg1xnvBH2a8ToOyNYAUiwONpt y9AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=WlKnZQl4TJky/PvRA17OtJ00ntkRW4dTPt3UAbRt65Q=; b=eMqn/6mpBb6+s+oTynRJT2DweRBQ2Sbq7AY3cr5LthNWMGxGm3E4J5SvQWF8XuTw5w osMjfPJEi6MgYbh+kalRf6GreA7uQTkXXPK5wIKZfvO5W1iGDHdX/fo9gB08vhemG0y/ mZykELDh3x+hNZmr2oLlQNwvqwiJqWxlN3rErU3ccyUp/9N6NuLWYNgHvsGgNSKn01Tz 6oFJTAFLWqHxev8cwr78f2/0Dojd3Va4y1ap2saDgklZPhqgmY+zNjMKz3+ICy7q9Y1T 8Gfw7p8yznzT/Cmz3+RyaSaqjQInI5o+/fnVyD5wQ8eYWLZRykElFNmH5EiOz0zTdiAR uP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b="4DofG/Rp"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z21-20020aa7cf95000000b005149cd84a05si1126539edx.445.2023.05.28.17.22.45; Sun, 28 May 2023 17:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b="4DofG/Rp"; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B38DD68C20F; Mon, 29 May 2023 03:22:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 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" X-TUID: sCcZFltnlSbU No Vulkan function is NULL-safe, for no real reason, despite the language defining and returning VK_NULL_HANDLE. Patch attached. 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