diff mbox series

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

Message ID HKAPR04MB392440136827D7116F0B29E3E8420@HKAPR04MB3924.apcprd04.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel] libavutil/hwcontext_d3d11va: missing unlock if d3d11va_create_staging_texture failed
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

xie.kunming Aug. 12, 2020, 2:43 a.m. UTC
Signed-off-by: xie.kunming <kunming.xie@hotmail.com>
---
 libavutil/hwcontext_d3d11va.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;