Commit 90f09635 authored by Eloi Gaudry's avatar Eloi Gaudry

Segfault in create awindow

there are some paths in the vtkXOpenGLRenderWindow (CreateAWindow for instance) that would need better NULL pointer check to avoid SEGFAULT and allow a clean abort.
this fix should also be merged to the release branch
parent 149919e1
......@@ -204,7 +204,7 @@ GLXFBConfig vtkXOpenGLRenderWindowTryForFBConfig(Display *DisplayId,
int tmp;
GLXFBConfig* fb = glXChooseFBConfig(DisplayId, XDefaultScreen(DisplayId),
attributes, &tmp);
if (tmp > 0)
if (fb && tmp > 0)
{
GLXFBConfig result = fb[0];
XFree(fb);
......@@ -495,6 +495,11 @@ void vtkXOpenGLRenderWindow::CreateAWindow()
if (!this->WindowId)
{
v = this->GetDesiredVisualInfo();
if (!v)
{
vtkErrorMacro(<< "Could not find a decent visual\n");
abort();
}
this->ColorMap = XCreateColormap(this->DisplayId,
XRootWindow(this->DisplayId,v->screen),
v->visual, AllocNone);
......
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