Kaydet (Commit) 19be6cfc authored tarafından Markus Mohrhard's avatar Markus Mohrhard

prevent crash with invalid XVisual, related fdo#80448

Change-Id: Ife020e3cbfabf0b397b189c17ffec8cbcb5d1505
üst eaca12bd
...@@ -492,6 +492,9 @@ bool OpenGLContext::ImplInit() ...@@ -492,6 +492,9 @@ bool OpenGLContext::ImplInit()
int best_fbc = -1; int best_fbc = -1;
const SystemEnvData* sysData(m_pChildWindow->GetSystemData()); const SystemEnvData* sysData(m_pChildWindow->GetSystemData());
GLXFBConfig* pFBC = getFBConfig(sysData, best_fbc); GLXFBConfig* pFBC = getFBConfig(sysData, best_fbc);
if (!pFBC)
return false;
int nContextAttribs[] = int nContextAttribs[] =
{ {
GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
...@@ -504,6 +507,9 @@ bool OpenGLContext::ImplInit() ...@@ -504,6 +507,9 @@ bool OpenGLContext::ImplInit()
#endif #endif
if (!m_aGLWin.ctx) if (!m_aGLWin.ctx)
{ {
if (!m_aGLWin.dpy || !m_aGLWin.vi)
return false;
m_aGLWin.ctx = m_aGLWin.dpy == 0 ? 0 : glXCreateContext(m_aGLWin.dpy, m_aGLWin.ctx = m_aGLWin.dpy == 0 ? 0 : glXCreateContext(m_aGLWin.dpy,
m_aGLWin.vi, m_aGLWin.vi,
0, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment