diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-09-07 19:33:18 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-09-07 19:36:08 +0200 |
commit | 19be6cfc93eb4f7d0b4440c42f698805294fb881 (patch) | |
tree | 1e051f01b7d26735342c57edb867a1bb1424d32a | |
parent | eaca12bdc9c8cdeaf05fec53743456148bfd88f0 (diff) |
prevent crash with invalid XVisual, related fdo#80448
Change-Id: Ife020e3cbfabf0b397b189c17ffec8cbcb5d1505
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 70ac761c39a6..4f73fb0db405 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -492,6 +492,9 @@ bool OpenGLContext::ImplInit() int best_fbc = -1; const SystemEnvData* sysData(m_pChildWindow->GetSystemData()); GLXFBConfig* pFBC = getFBConfig(sysData, best_fbc); + if (!pFBC) + return false; + int nContextAttribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 3, @@ -504,6 +507,9 @@ bool OpenGLContext::ImplInit() #endif 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.vi, 0, |