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 A872246439 for ; Thu, 18 May 2023 11:07:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 33CF768C167; Thu, 18 May 2023 14:07:16 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 268EB68BBE3 for ; Thu, 18 May 2023 14:07:09 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id CFD1610602F8 for ; Thu, 18 May 2023 11:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1684408026; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=1LWkczKugFqZxJwi8CF+7WqT7kOiNV+BR3080F6Tjxk=; b=Gn5Jc14mkMSBhtOMQfHqtrFWlreHt7tNj4Hg+wg55uFWPBeMdMgdNKcclkhIuiRv t8smKVLGO3qNcLUcEg2aUAXFhftgmfv0MWhlvO7A4RRbgaOzTK+wJsg87ON9CywLTcI WeF+wvDAPgKw6H8VSpob6KFhNLdNcIcyT0N0VYyXkz00OuB8/GfzltBIkL9qn0jPVxb zmwDFn2rFDMk789+naFUDv6haIpKC3cU8rR0QsO+Wmy07cBFathuFeoFNCZSms+aefy YzJeZJI/Xa+HFkrK8+tWKPL5in7uyaKc5pyh4W4pVmiNY1VeTqCo9h8Lq4AJ4f1hvNY qBD6qU3fTA== Date: Thu, 18 May 2023 13:07:06 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <168439886956.3843.15772842482127825125@lain.khirnov.net> References: <168439886956.3843.15772842482127825125@lain.khirnov.net> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] libavcodec: add Vulkan common video code 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 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: May 18, 2023, 10:34 by anton@khirnov.net: >> commit 3257feba101053b0b3689147c1a8850f68448f62 >> Author: Lynne >> Date: Sun Dec 18 08:31:03 2022 +0100 >> >> libavcodec: add Vulkan common video code >> >> +static AVBufferRef *alloc_data_buf(void *opaque, size_t size) >> +{ >> + uint8_t *buf = av_mallocz(size); >> + if (!buf) >> + return NULL; >> + >> + return av_buffer_create(buf, size, free_data_buf, opaque, 0); >> > > leaks buf on av_buffer_create() failure. > fixed >> +av_cold int ff_vk_video_common_init(void *log, FFVulkanContext *s, >> + FFVkVideoCommon *common, >> + VkVideoSessionCreateInfoKHR *session_create) >> +{ >> + int err; >> + VkResult ret; >> + FFVulkanFunctions *vk = &s->vkfn; >> + VkMemoryRequirements2 *mem_req = NULL; >> + VkVideoSessionMemoryRequirementsKHR *mem = NULL; >> + VkBindVideoSessionMemoryInfoKHR *bind_mem = NULL; >> + >> + /* Create session */ >> + ret = vk->CreateVideoSessionKHR(s->hwctx->act_dev, session_create, >> + s->hwctx->alloc, &common->session); >> + if (ret != VK_SUCCESS) >> + return AVERROR_EXTERNAL; >> + >> + /* Get memory requirements */ >> + ret = vk->GetVideoSessionMemoryRequirementsKHR(s->hwctx->act_dev, >> + common->session, >> + &common->nb_mem, >> + NULL); >> + if (ret != VK_SUCCESS) { >> + err = AVERROR_EXTERNAL; >> + goto fail; >> + } >> + >> + /* Allocate all memory needed to actually allocate memory */ >> + common->mem = av_mallocz(sizeof(*common->mem)*common->nb_mem); >> > > av_calloc(), same below > Fixed all av_mallocz usage in the file _______________________________________________ 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".