Don't use EGLRenderer if not built with SDL 2.0.10+

This commit is contained in:
Cameron Gutman 2020-05-13 19:19:11 -07:00
parent eb9e1f81d4
commit eb9d54465c

View file

@ -182,6 +182,16 @@ bool EGLRenderer::initialize(PDECODER_PARAMETERS params)
return false;
}
// It's not safe to attempt to opportunistically create a GLES2
// renderer prior to 2.0.10. If GLES2 isn't available, SDL will
// attempt to dereference a null pointer and crash Moonlight.
// https://bugzilla.libsdl.org/show_bug.cgi?id=4350
// https://hg.libsdl.org/SDL/rev/84618d571795
if (!SDL_VERSION_ATLEAST(2, 0, 10)) {
EGL_LOG(Error, "Not supported until SDL 2.0.10");
return false;
}
/*
* Create a dummy renderer in order to craft an accelerated SDL Window.
* Request opengl ES 3.0 context, otherwise it will SIGSEGV