[FFmpeg-devel] [PATCH] libavutil/hwcontext_d3d11va: missing unlock if d3d11va_create_staging_texture failed

xie.kunming kunming.xie at hotmail.com
Wed Aug 12 05:43:07 EEST 2020


Signed-off-by: xie.kunming <kunming.xie at hotmail.com>
---
 libavutil/hwcontext_d3d11va.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index c8ae58f908..4524b01c20 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -391,8 +391,10 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
 
     if (!s->staging_texture) {
         int res = d3d11va_create_staging_texture(ctx);
-        if (res < 0)
+        if (res < 0) {
+            device_hwctx->unlock(device_hwctx->lock_ctx);
             return res;
+        }
     }
 
     staging = (ID3D11Resource *)s->staging_texture;
-- 
2.14.2.windows.2



More information about the ffmpeg-devel mailing list