[vtkusers] Critical bug in vtkDepthSortPolyData in VTK7

David Lonie david.lonie at kitware.com
Mon Aug 22 11:09:40 EDT 2016


MR up: https://gitlab.kitware.com/vtk/vtk/merge_requests/1863

On Mon, Aug 22, 2016 at 10:59 AM, David Lonie <david.lonie at kitware.com>
wrote:

> Good catch -- looks like a slip up because VTK's APIs are unconventional
> (GetSize() returns capacity, not number of elements as one would expect).
> I'll make a merge request for this.
>
> Thanks!
> Dave
>
> On Mon, Aug 22, 2016 at 5:42 AM, Pavel Krebs/AMBERG <pkrebs at amberg.cz>
> wrote:
>
>> 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()->GetNumber
>> OfConnectivityEntries());
>>         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: <https://plus.google.com/u/0/115687889920250804536/posts>
>> <http://www.leica-geosystems.com/facebook>
>> <http://www.facebook.com/AmbergTech> <http://www.facebool.com/AmbergTech>
>> <http://www.linkedin.com/company/amberg-technologies>
>> <http://www.twitter.com/AmbergTech>
>> <http://www.youtube.com/user/AmbergTechnologies>
>>
>> Visit us at these exhibitions, we are looking forward to meeting you!
>> <http://hxgnlive.com/en/anaheim> <http://www.retc.org>
>> Hall 25, booth no. 314                Hall A3, booth no. D3.001
>> September 20 - 23, 2016                 October 11 - 13, 2016
>> Berlin, Germany                        Hamburg, Germany
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160822/0df9f4a5/attachment.html>
-------------- 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/0df9f4a5/attachment.gif>
-------------- 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/0df9f4a5/attachment-0001.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/0df9f4a5/attachment-0002.gif>
-------------- 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/0df9f4a5/attachment.jpe>
-------------- 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/0df9f4a5/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/0df9f4a5/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/0df9f4a5/attachment-0002.jpe>


More information about the vtkusers mailing list