[vlc-commits] opengl: vaapi: fix UB when surface type and module doesn't match

Thomas Guillem git at videolan.org
Mon Dec 4 09:29:18 CET 2017


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Dec  4 09:22:45 2017 +0100| [46b2ac113a29879e4d534a9a142392d60bb40b09] | committer: Thomas Guillem

opengl: vaapi: fix UB when surface type and module doesn't match

Fixes #19204

(cherry picked from 7c0a6a24a78f7b965732517605d78872abab87e8)

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

 modules/video_output/opengl/converter_vaapi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
index 6fb1a6e3d6..fe6a578ed3 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -444,7 +444,7 @@ Open(vlc_object_t *obj)
     if (priv->glEGLImageTargetTexture2DOES == NULL)
         goto error;
 
-    int ret;
+    int ret = VLC_EGENERIC;
 #if defined (HAVE_VA_X11)
     if (tc->gl->surface->type == VOUT_WINDOW_TYPE_XID)
         ret = x11_init_vaapi_instance(tc, priv);
@@ -460,6 +460,8 @@ Open(vlc_object_t *obj)
     if (ret != VLC_SUCCESS)
         goto error;
 
+    assert(priv->vadpy != NULL && priv->vainst != NULL);
+
     if (tc_va_check_interop_blacklist(tc, priv->vadpy))
         goto error;
 



More information about the vlc-commits mailing list