[vlc-commits] dxva: fix success returned when directx_va_Setup failed

Steve Lhomme git at videolan.org
Mon Oct 14 12:46:19 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct 14 12:26:20 2019 +0200| [fa5566fd12ff9a2ce58e08803a107a84497bd0e1] | committer: Steve Lhomme

dxva: fix success returned when directx_va_Setup failed

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fa5566fd12ff9a2ce58e08803a107a84497bd0e1
---

 modules/codec/avcodec/d3d11va.c | 3 +++
 modules/codec/avcodec/dxva2.c   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index e41a61e544..8fa15e640d 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -403,7 +403,10 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
     static const directx_sys_t dx_sys = { DxGetInputList, DxSetupOutput };
     sys->selected_decoder = directx_va_Setup(va, &dx_sys, ctx, desc, fmt, isXboxHardware(sys->d3d_dev.d3ddevice), &fmt_out, &sys->hw.surface_count);
     if (sys->selected_decoder == NULL)
+    {
+        err = VLC_EGENERIC;
         goto error;
+    }
 
     err = va_pool_SetupDecoder(va, sys->va_pool, ctx, &fmt_out, sys->hw.surface_count);
     if (err != VLC_SUCCESS)
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index aa05d6095a..02f71b2028 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -326,7 +326,10 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
     static const directx_sys_t dx_sys = { DxGetInputList, DxSetupOutput };
     sys->selected_decoder = directx_va_Setup(va, &dx_sys, ctx, desc, fmt, 0, &fmt_out, &sys->hw.surface_count);
     if (sys->selected_decoder == NULL)
+    {
+        err = VLC_EGENERIC;
         goto error;
+    }
 
     err = va_pool_SetupDecoder(va, sys->va_pool, ctx, &fmt_out, sys->hw.surface_count);
     if (err != VLC_SUCCESS)



More information about the vlc-commits mailing list