vo_gpu: hwdec_vaapi_gl: use gl_check_extension() instead of strstr()

In theory, using strstr() to search for extensions is a bad idea,
because some extension names might be prefixes for other names, so you
could get false positives. gl_check_extension() avoids this case.

It's not clear whether this is really needed; maybe not. Surely the EGL
committee is aware of these practices (many GL clients do this, which is
why it's widely considered bad practice), and would avoid defining new
extension names which contain existing names as sub-strings, but
whatever.
This commit is contained in:
wm4 2019-12-07 14:16:30 +01:00
parent 16b9c4c952
commit d90d5ee1a0
1 changed files with 3 additions and 3 deletions

View File

@ -251,9 +251,9 @@ bool vaapi_gl_init(const struct ra_hwdec *hw)
return false;
GL *gl = ra_gl_get(hw->ra);
if (!strstr(exts, "EXT_image_dma_buf_import") ||
!strstr(exts, "EGL_KHR_image_base") ||
!strstr(gl->extensions, "GL_OES_EGL_image") ||
if (!gl_check_extension(exts, "EGL_EXT_image_dma_buf_import") ||
!gl_check_extension(exts, "EGL_KHR_image_base") ||
!gl_check_extension(gl->extensions, "GL_OES_EGL_image") ||
!(gl->mpgl_caps & MPGL_CAP_TEX_RG))
return false;