[vtkusers] Critical bug in vtkDepthSortPolyData in VTK7

Pavel Krebs/AMBERG pkrebs at amberg.cz
Mon Aug 22 05:42:20 EDT 2016


Hi all,
during moving from vtk 6.2 to vtk 7 (with enabled OpenGL2 backend 
rendering) we found serious bug in vtkDepthSortPolyData filter. There is a 
problem with generating of output vtkPolyData object. There are usage of 
wrong sizes for vtkCellArray for Vert, Lines, Polys,... Instead of real 
size the allocated size is used. Later in the rendering request 
uninitialised cell ids are used and rendering can crash.
I changed the code like this and it works now. Should be good to fix it 
also in VTK7 source code repository.

int vtkDepthSortPolyData::RequestData(
    vtkInformation *vtkNotUsed(request),
    vtkInformationVector **inputVector,
    vtkInformationVector *outputVector)
{
.
.
.
    vtkIdType *pOutputPolys = NULL;
    if (nPolys)
    {
        vtkCellArray *outputPolyCells = vtkCellArray::New();
        outputPolyCells->SetNumberOfCells(nPolys);
        output->SetPolys(outputPolyCells);
        outputPolyCells->Delete();
        vtkIdTypeArray *outputPolys = outputPolyCells->GetData();
-        outputPolys->SetNumberOfTuples(input->GetPolys()->GetSize());
+ 
outputPolys->SetNumberOfTuples(input->GetPolys()->GetNumberOfConnectivityEntries());
        pOutputPolys = outputPolys->GetPointer(0);
    }
.
.
.
}

Kind regards
 
Pavel Krebs
Software Engineer

AMBERG Engineering Brno, a.s.
Ptašínského 10
602 00 Brno - Czech Republic

Phone: +420 541 432 662
E-Mail: pkrebs at amberg.cz
www.amberg.ch/at

Follow us on:     

Visit us at these exhibitions, we are looking forward to meeting you!
 
Hall 25, booth no. 314          Hall A3, booth no. D3.001
September 20 - 23, 2016                 October 11 - 13, 2016
Berlin, Germany                 Hamburg, Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 815 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 303 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 449 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 498 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 687 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 34523 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment-0001.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 31529 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/bf6fce83/attachment-0002.jpe>


More information about the vtkusers mailing list