mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
glcontext: fixup strstr lengths so we don't overrun
This commit is contained in:
parent
49e6516550
commit
b8cb829e46
1 changed files with 4 additions and 5 deletions
|
@ -310,7 +310,7 @@ gst_gl_context_new (GstGLDisplay * display)
|
|||
GST_INFO ("creating a context for display %" GST_PTR_FORMAT
|
||||
", user choice:%s", display, user_choice);
|
||||
#if GST_GL_HAVE_PLATFORM_CGL
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 5, "cgl")))
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "cgl")))
|
||||
context = GST_GL_CONTEXT (gst_gl_context_cocoa_new (display));
|
||||
#endif
|
||||
#if GST_GL_HAVE_PLATFORM_GLX
|
||||
|
@ -318,16 +318,15 @@ gst_gl_context_new (GstGLDisplay * display)
|
|||
context = GST_GL_CONTEXT (gst_gl_context_glx_new (display));
|
||||
#endif
|
||||
#if GST_GL_HAVE_PLATFORM_EGL
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 7, "egl")))
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "egl")))
|
||||
context = GST_GL_CONTEXT (gst_gl_context_egl_new (display));
|
||||
#endif
|
||||
#if GST_GL_HAVE_PLATFORM_WGL
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "wgl"))) {
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 3, "wgl")))
|
||||
context = GST_GL_CONTEXT (gst_gl_context_wgl_new (display));
|
||||
}
|
||||
#endif
|
||||
#if GST_GL_HAVE_PLATFORM_EAGL
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 5, "eagl")))
|
||||
if (!context && (!user_choice || g_strstr_len (user_choice, 4, "eagl")))
|
||||
context = GST_GL_CONTEXT (gst_gl_context_eagl_new (display));
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue