[vlc-commits] gl: vaapi: fix clean-up in case of error

Thomas Guillem git at videolan.org
Wed Jun 21 14:45:15 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jun 21 14:44:44 2017 +0200| [ec574c67ca20c283cce6e310da506d5a2e52a378] | committer: Thomas Guillem

gl: vaapi: fix clean-up in case of error

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

 modules/video_output/opengl/converter_vaapi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
index 83ea67e0e0..196cb6c47b 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -278,8 +278,12 @@ tc_vaegl_init(video_format_t *fmt, opengl_tex_converter_t *tc, VADisplay *vadpy)
         return 0;
     }
 
-    return opengl_fragment_shader_init(tc, GL_TEXTURE_2D, VLC_CODEC_NV12,
-                                       fmt->space);
+    GLuint fshader =
+        opengl_fragment_shader_init(tc, GL_TEXTURE_2D, VLC_CODEC_NV12,
+                                    fmt->space);
+    if (fshader == 0)
+        vlc_vaapi_ReleaseInstance(priv->vadpy);
+    return fshader;
 #undef GETPROC
 }
 



More information about the vlc-commits mailing list