From patchwork Wed Jan 19 13:40:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 33656 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4796680iog; Wed, 19 Jan 2022 05:41:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzThJkvu+fuX10MtEMCrSaR4xzWUBxaDIQ+uJ9wO8OV8mDe8wS2J5E0/Uv2rd6qMDhNNBLm X-Received: by 2002:a17:906:7315:: with SMTP id di21mr23921505ejc.700.1642599695743; Wed, 19 Jan 2022 05:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642599695; cv=none; d=google.com; s=arc-20160816; b=gCcb61PrzC6v6YrWU4+vW+WFFE5//zylSJtUdnp4JeplHOmwWWEFoOB6DAKyR1eEX0 GWoMjjkOODV04hhaIuPQU5CcII03m7Poghlpuz5DNgWo6ISfCNpKgkbM3HQwAlTMhlrw 8f51UPM8+L/J1iTdMS9zzcNq4O7Be+I3uawdNS5CxeHEvwX1Z0PsCNtEgFjfPGeJc3Y8 E+0MHMuTnQvO5hBy6ouKHghCLsb4Td8hk1OZ+ernFR4VHdnhwLJxhdjNPqyWUhm/rvWk 4D0jdssCy5wsIusb65EfhLqtiwh3n/zC8Nl2pUfgaP1aNUzpqOM6vA/hnQKAjtibth5v TcKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=eFwxWReb9Y066TBoorecSFW4teUvffMv5n6TW+jO6jg=; b=eVzoG3ExW1DzCEW1hW8Kd1nzAKW9Rqa2zmyIe0U5Ir9fNayg2JRI0wiFVzFrjMAcjw sm6/bBwLm9SEkUmb45pEL6EdOPqEu5CgKy7Ex2XxTOg5Ui9B1V8fV/n793j7RjTEezMM C5SN7XlxwQx1RYHA+snXAAGcXTnqYRFkq7oWnAcMGeV4ssQFnZXEUQ7NTcX4f6v96XFX +zjpJ6jUxGXmsGLtsooKxv3VkOsrxLObiXXPaQ0k2MmtwoFY4whJU3YoC72CGBeEVgaC Aru1hXhE0qm28A/RSkXEXuqO2r01EtHhECfipKAfr+LX2DpwS+bWoPNNn8eB468jkk5I GX8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gv2si4975994ejc.466.2022.01.19.05.41.34; Wed, 19 Jan 2022 05:41:35 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9ACB968B097; Wed, 19 Jan 2022 15:41:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6E7A68AFF0 for ; Wed, 19 Jan 2022 15:41:24 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 2B0EC24017C for ; Wed, 19 Jan 2022 14:41:24 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id U4TtuFZAslzd for ; Wed, 19 Jan 2022 14:41:22 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id E9A12240179 for ; Wed, 19 Jan 2022 14:41:22 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id DC3953A067C; Wed, 19 Jan 2022 14:41:22 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jan 2022 14:40:40 +0100 Message-Id: <20220119134040.774-1-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavu/hwcontext_opencl: clear dangling pointers on map failure 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: YqOtSSfPKKJY --- untested --- libavutil/hwcontext_opencl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 26a3a24593..40ee611943 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -2146,6 +2146,7 @@ fail: clReleaseMemObject(mapping->frame.planes[p]); } av_free(mapping); + memset(dst->data, 0, sizeof(dst->data)); return err; } @@ -2317,6 +2318,7 @@ fail: if (desc->planes[p]) clReleaseMemObject(desc->planes[p]); av_freep(&desc); + memset(dst->data, 0, sizeof(dst->data)); return err; } @@ -2407,6 +2409,7 @@ fail: 0, NULL, &event); if (cle == CL_SUCCESS) opencl_wait_events(dst_fc, &event, 1); + memset(dst->data, 0, sizeof(dst->data)); return err; } @@ -2562,6 +2565,7 @@ fail: 0, NULL, &event); if (cle == CL_SUCCESS) opencl_wait_events(dst_fc, &event, 1); + memset(dst->data, 0, sizeof(dst->data)); return err; } @@ -2793,6 +2797,7 @@ fail: clReleaseMemObject(mapping->object_buffers[i]); } av_free(mapping); + memset(dst->data, 0, sizeof(dst->data)); return err; } From patchwork Wed Jan 19 13:40:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 33657 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4796795iog; Wed, 19 Jan 2022 05:41:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLAEGIjuU5Z9S9V+phrn5NbQkv1tnpQvbGRnkgg8OOdmcqaepfo+7LhZsSICnKDZEKWAg0 X-Received: by 2002:a17:906:c301:: with SMTP id s1mr24400618ejz.505.1642599705247; Wed, 19 Jan 2022 05:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642599705; cv=none; d=google.com; s=arc-20160816; b=oLphZWFkCqZ08/dOimZBJ6Xxz4GuPbK/DNmu5wYpclgjW6dOlDqA3IckwiiD9fGZ5p 1cZzSN02t7nGij9ieDBKAmrT1wpO0Q5TQ7gXM8QRV6PRz/BapPKdCGcINnUNaXLIhsrk kH2MBNOYx4iSG50sdLn6bPEwsXozoQiA87bYWb+9WMoTOyVI+Qs5ffY2a1ycywmNOnwU kRunKVViEXruZR2KOM2ZvfNkFjM7quDHtUHNW+FDFcbSq9khowR6Elj2HNrdfXfgOjtr CedbIpGiG44prA/WxT1GmfGBdj+KVOjkwYolNgEPmBefRCbrRBAQWQsPmByp/dXm9XxC KW9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=YYFOwuQD8x657OyXt8WfifKjii6sOMMKHVbQae+zJSc=; b=pmjAwnEJt6hKuUTPtFzGM7xwJogTnwmaLNeIJg7LkZOWzzp+X7VeCuCJIpQWW3QbTg EvAOz1n71a4KpgOZ3t0bhwSoFmTYPMwkrLcJbZEibsNk99d1IVSTsc6NF2MR76dZHip6 14+w28AWDJZchu41GaEn2JfsLJk9NaTv+EI0oexTTBRitpsVtwGR8f/DRpznpKl4NmJM /HXSukxYiOTvCVOwZtOiIuWi2G90pxtKTcLbSUKQR64fb3A/z4A5FvjwFh+Nr8TwkNq6 pWfuuNEZ5U13KpJM8UoxBxlDJWtfXNg/Umfhb5v9h1hEMf/DYjhrGXA9BSrGH+5M2YgF fxqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i26si1844950eda.266.2022.01.19.05.41.44; Wed, 19 Jan 2022 05:41:45 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6EFD68B0B0; Wed, 19 Jan 2022 15:41:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A4BC468B087 for ; Wed, 19 Jan 2022 15:41:30 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 3C37524017C for ; Wed, 19 Jan 2022 14:41:30 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id QRSMWQuR6zNK for ; Wed, 19 Jan 2022 14:41:29 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id CCC2D240179 for ; Wed, 19 Jan 2022 14:41:29 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 9C3003A067C; Wed, 19 Jan 2022 14:41:29 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jan 2022 14:40:42 +0100 Message-Id: <20220119134040.774-2-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220119134040.774-1-anton@khirnov.net> References: <20220119134040.774-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] lavu/hwcontext_vulkan: clear dangling pointers on map failure 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: xzd67s9jGKyz --- untested --- libavutil/hwcontext_vulkan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 60a6cf6a91..ae19fc2ab6 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -2927,6 +2927,7 @@ static int vulkan_map_from_drm(AVHWFramesContext *hwfc, AVFrame *dst, fail: vulkan_frame_free(hwfc->device_ctx->hwctx, (uint8_t *)f); + dst->data[0] = NULL; return err; } From patchwork Wed Jan 19 13:40:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 33658 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4796935iog; Wed, 19 Jan 2022 05:41:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0wp9BAg5oRtei8rFpHJpAFxmUmFgJ2UkQ9OgM8uW02Tr24Sm+fwioUc5xASUAPB+nbnbE X-Received: by 2002:a17:907:1b0d:: with SMTP id mp13mr24047656ejc.29.1642599714558; Wed, 19 Jan 2022 05:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642599714; cv=none; d=google.com; s=arc-20160816; b=SZL7JrhqAuGbKkvQ2TmOXT4AB1ACrBn7HZ7pn4Xoy/KCkne4E8JjNKo7Hnao2ixZLe E2gQtfoNT/6Po/MLdnJsL7kVwv78SEoTnvgRdDyD24mKK8Rbe8LCq3YE7yllLZ1vGc3y nlXbk9gf69F2r5OsQBUgX+JhwXsiCY9M51MzP7t8siXe8xerNp/fa5+aIJJFKEouQM4D VA1OdPk0RxwshCnUAtcHfB9w/de+BVHCah7vNY6i50OGRVEeSfgdkytVf2IVev+3gjlE 34vJxheN0dhzZ0rGb00rS2V7LM8cVOkjkM3/pPP7uuR9Zh54ZkhZ4ABPYkp+inUs9ykg Qslg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=io8O74izxaJw0pPGnxHgU47m+rrHuHNelbXoMiDjvH0=; b=sfjVcPMh5roT1/HjN4W/mIiFtqeqWlyI1CCNzqj+IXcvr1C+q0xG9UpKWBR/O+v6YQ lev4QKIpnndGYWQA4GNDYxNQQbChtP8EL0nGhMN5/Y+n2fbLIAjKokHUofPNMWNP2doW weMGOvtGYUr7Df8HO8h4rGXxAH0NHXaAfY0Kih72HdMF3lk0M46jcnIx/Ho4JhIh3npP sxuK57rQTf12jhz3+q9bhaF1mJHftqg9beq6fAk0hJr6nHQIAkfWiLJ3KdQzE5e23c1S TEkCQX70l/TK9sT57U3QnCposn55XynNMuVDjvwecwDsIuhlnWliRns/ID5F8hXqzrqU MBDg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m18si2077412edd.21.2022.01.19.05.41.54; Wed, 19 Jan 2022 05:41:54 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7EC368B0BB; Wed, 19 Jan 2022 15:41:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D545F68B0B1 for ; Wed, 19 Jan 2022 15:41:31 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 7247424017E for ; Wed, 19 Jan 2022 14:41:31 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id OulUdPRXgnSY for ; Wed, 19 Jan 2022 14:41:30 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id DC47E240179 for ; Wed, 19 Jan 2022 14:41:30 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id C42FB3A067C; Wed, 19 Jan 2022 14:41:30 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jan 2022 14:40:43 +0100 Message-Id: <20220119134040.774-3-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220119134040.774-1-anton@khirnov.net> References: <20220119134040.774-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavu/hwcontext: clarify behavior on av_hwframe_map() failure 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: e5hlDUCUgxAJ Clear anything that av_hwframe_map() might have done to the destination frame, but leave caller-provided fields unchanged. --- libavutil/hwcontext.c | 23 +++++++++++++++++++++-- libavutil/hwcontext.h | 4 ++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index 31c7840dba..ae33da1262 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -18,6 +18,7 @@ #include "config.h" +#include "avassert.h" #include "buffer.h" #include "common.h" #include "hwcontext.h" @@ -788,6 +789,8 @@ fail: int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) { + AVBufferRef *orig_dst_frames = dst->hw_frames_ctx; + enum AVPixelFormat orig_dst_fmt = dst->format; AVHWFramesContext *src_frames, *dst_frames; HWMapDescriptor *hwmap; int ret; @@ -825,7 +828,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) ret = src_frames->internal->hw_type->map_from(src_frames, dst, src, flags); if (ret != AVERROR(ENOSYS)) - return ret; + goto fail; } } @@ -837,11 +840,27 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags) ret = dst_frames->internal->hw_type->map_to(dst_frames, dst, src, flags); if (ret != AVERROR(ENOSYS)) - return ret; + goto fail; } } return AVERROR(ENOSYS); + +fail: + // if the caller provided dst frames context, it should be preserved + // by this function + av_assert0(orig_dst_frames == NULL || + orig_dst_frames == dst->hw_frames_ctx); + + // preserve user-provided dst frame fields, but clean + // anything we might have set + dst->hw_frames_ctx = NULL; + av_frame_unref(dst); + + dst->hw_frames_ctx = orig_dst_frames; + dst->format = orig_dst_fmt; + + return ret; } int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx, diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h index 04d19d89c2..c18b7e1e8b 100644 --- a/libavutil/hwcontext.h +++ b/libavutil/hwcontext.h @@ -571,6 +571,10 @@ enum { * possible with the given arguments and hwframe setup, while other return * values indicate that it failed somehow. * + * On failure, the destination frame will be left blank, except for the + * hw_frames_ctx/format fields thay may have been set by the caller - those will + * be preserved as they were. + * * @param dst Destination frame, to contain the mapping. * @param src Source frame, to be mapped. * @param flags Some combination of AV_HWFRAME_MAP_* flags.