From 19be6cfc93eb4f7d0b4440c42f698805294fb881 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 7 Sep 2014 19:33:18 +0200 Subject: prevent crash with invalid XVisual, related fdo#80448 Change-Id: Ife020e3cbfabf0b397b189c17ffec8cbcb5d1505 --- vcl/source/opengl/OpenGLContext.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl') 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, -- cgit