[vlc-commits] dxva2: fix bogus calls to Close when va->sys is not set

Steve Lhomme git at videolan.org
Mon Sep 23 13:24:48 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 23 08:23:56 2019 +0200| [b05e561be637b6ac8028ac7cb84cc52a67290ab0] | committer: Steve Lhomme

dxva2: fix bogus calls to Close when va->sys is not set

Following 2c9de5ebec2adc701c6cb2a241e561eed8097bad cleaning

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

 modules/codec/avcodec/dxva2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index c6ecbe40bd..24eb59415c 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -264,14 +264,14 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
         if ( FAILED(IDirect3DSurface9_GetDevice( p_sys->surface, &device )) )
         {
             free( sys );
-            goto error;
+            return VLC_EGENERIC;
         }
         if ( D3D9_CreateExternal(&sys->hd3d, device) != VLC_SUCCESS ||
              FAILED(D3D9_CreateDeviceExternal( device, &sys->hd3d, &sys->d3d_dev)) )
         {
             IDirect3DDevice9_Release(device);
             free( sys );
-            goto error;
+            return VLC_EGENERIC;
         }
         D3DSURFACE_DESC src;
         if (SUCCEEDED(IDirect3DSurface9_GetDesc(p_sys->surface, &src)))
@@ -280,7 +280,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     else if (D3D9_Create(va, &sys->hd3d) != VLC_SUCCESS) {
         msg_Warn(va, "cannot load d3d9.dll");
         free( sys );
-        goto error;
+        return VLC_EGENERIC;
     }
 
     /* Load dll*/



More information about the vlc-commits mailing list