[vlc-commits] dxva2: only call Close when va->sys is set

Steve Lhomme git at videolan.org
Mon Sep 2 15:43:22 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep  2 12:38:29 2019 +0200| [2c9de5ebec2adc701c6cb2a241e561eed8097bad] | committer: Steve Lhomme

dxva2: only call Close when va->sys is set

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

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

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 44a12ad10a..695b3f63ae 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -232,8 +232,6 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
 static void Close(vlc_va_t *va)
 {
     vlc_va_sys_t *sys = va->sys;
-    if ( sys == NULL )
-        return;
 
     directx_va_Close(va, &sys->dx_sys);
 
@@ -292,7 +290,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
         msg_Warn(va, "cannot load DXVA2 decoder DLL");
         D3D9_Destroy( &sys->hd3d );
         free( sys );
-        goto error;
+        return VLC_EGENERIC;
     }
 
     dx_sys = &sys->dx_sys;



More information about the vlc-commits mailing list