<div dir="ltr">Interestin. I just did a<div>git grep GetSize</div><div>and looked for its use for Polys.</div><div><br></div><div>It occurs many times, but mainly in Allocate() statements. This means we could be over allocating althought I expect that must Polys have been Squeezed.</div><div><br></div><div>I did find these uses:</div><div><div>IO/Xdmf2/vtkXdmfWriter.cxx: vtkIdType sizev = pd->GetVerts()->GetSize();</div><div>IO/Xdmf2/vtkXdmfWriter.cxx: vtkIdType sizel = pd->GetLines()->GetSize();</div><div>IO/Xdmf2/vtkXdmfWriter.cxx: vtkIdType sizep = pd->GetPolys()->GetSize();</div><div>IO/Xdmf2/vtkXdmfWriter.cxx: vtkIdType sizes = pd->GetStrips()->GetSize();</div></div><div><br></div><div>Which look like they could be errors.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 22, 2016 at 11:09 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">MR up: <a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/1863" target="_blank">https://gitlab.kitware.<wbr>com/vtk/vtk/merge_requests/<wbr>1863</a></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 22, 2016 at 10:59 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>Thanks!</div><div>Dave</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Aug 22, 2016 at 5:42 AM, Pavel Krebs/AMBERG <span dir="ltr"><<a href="mailto:pkrebs@amberg.cz" target="_blank">pkrebs@amberg.cz</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><font size="2" face="sans-serif">Hi all,</font>
<br><font size="2" face="sans-serif">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.</font>
<br><font size="2" face="sans-serif">I changed the code like this and it
works now. Should be good to fix it also in VTK7 source code repository.</font>
<br>
<br><font size="1" face="}">int vtkDepthSortPolyData::RequestD<wbr>ata(</font>
<br><font size="1" face="}"> vtkInformation *vtkNotUsed(request),</font>
<br><font size="1" face="}"> vtkInformationVector **inputVector,</font>
<br><font size="1" face="}"> vtkInformationVector *outputVector)</font>
<br><font size="1" face="}">{</font>
<br><font size="1" face="}">.</font>
<br><font size="1" face="}">.</font>
<br><font size="1" face="}">.</font>
<br><font size="1" face="}"> vtkIdType *pOutputPolys = NULL;</font>
<br><font size="1" face="}"> if (nPolys)</font>
<br><font size="1" face="}"> {</font>
<br><font size="1" face="}"> vtkCellArray *outputPolyCells
= vtkCellArray::New();</font>
<br><font size="1" face="}"> outputPolyCells->SetNumberOfCe<wbr>lls(nPolys);</font>
<br><font size="1" face="}"> output->SetPolys(outputPolyCel<wbr>ls);</font>
<br><font size="1" face="}"> outputPolyCells->Delete();</font>
<br><font size="1" face="}"> vtkIdTypeArray *outputPolys
= outputPolyCells->GetData();</font>
<br><font size="1" face="}">- outputPolys->SetNumberOfTuple<wbr>s(input->GetPolys()->GetSize()<wbr>);</font>
<br><font size="1" face="}">+ outputPolys->SetNumberOfTuple<wbr>s(input->GetPolys()->GetNumber<wbr>OfConnectivityEntries());</font>
<br><font size="1" face="}"> pOutputPolys = outputPolys->GetPointer(0);</font>
<br><font size="1" face="}"> }</font>
<br><font size="2" face="sans-serif">.</font>
<br><font size="2" face="sans-serif">.</font>
<br><font size="2" face="sans-serif">.</font>
<br><font size="2" face="sans-serif">}</font>
<br>
<br><font size="2" face="sans-serif">Kind regards</font>
<br><font size="2" face="sans-serif"> </font>
<br><font size="2" face="sans-serif">Pavel Krebs</font>
<br><font size="2" face="sans-serif">Software Engineer</font>
<br>
<br><font size="1" face="sans-serif">AMBERG Engineering Brno, a.s.</font>
<br><font size="1" face="sans-serif">Ptašínského 10</font>
<br><font size="1" face="sans-serif">602 00 Brno - Czech Republic</font>
<br>
<br><font size="1" face="sans-serif">Phone: <a href="tel:%2B420%20541%20432%20662" value="+420541432662" target="_blank">+420 541 432 662</a></font>
<br><font size="1" face="sans-serif">E-Mail: <a href="mailto:pkrebs@amberg.cz" target="_blank">pkrebs@amberg.cz</a></font>
<br><a href="http://www.amberg.ch/at" target="_blank"><font size="1" color="blue" face="sans-serif">www.amberg.ch/at</font></a>
<br>
<br><font size="1" face="SansSerif">Follow us on: </font><a href="https://plus.google.com/u/0/115687889920250804536/posts" target="_blank"><img src="cid:_2_0B6C39D00B6C365400355075C1258017" style="border:0px solid"></a><font size="1" face="SansSerif"> </font><a href="http://www.leica-geosystems.com/facebook" target="_blank"></a><a href="http://www.facebook.com/AmbergTech" target="_blank"><img src="cid:_1_0B6C40200B6C365400355075C1258017" style="border:0px solid"></a><a href="http://www.facebool.com/AmbergTech" target="_blank"></a><font size="1" face="SansSerif">
</font><a href="http://www.linkedin.com/company/amberg-technologies" target="_blank"><img src="cid:_1_0B6C46700B6C365400355075C1258017" width="23" height="23" style="border:0px solid"></a><font size="1" face="SansSerif"> </font><a href="http://www.twitter.com/AmbergTech" target="_blank"><img src="cid:_1_0B6C4ABC0B6C365400355075C1258017" style="border:0px solid"></a><font size="1" face="SansSerif">
</font><a href="http://www.youtube.com/user/AmbergTechnologies" target="_blank"><img src="cid:_1_0B6C4F080B6C365400355075C1258017" width="25" height="23" style="border:0px solid"></a>
<br>
<br><font size="1" face="sans-serif">Visit us at these exhibitions, we are
looking forward to meeting you!</font>
<br><a href="http://hxgnlive.com/en/anaheim" target="_blank"></a><a href="http://www.retc.org" target="_blank"></a><img src="cid:_2_0B6C5DD40B6C577C00355075C1258017" style="border:0px solid"><font size="1" color="blue" face="sans-serif">
</font><img src="cid:_2_0B6C601C0B6C577C00355075C1258017" style="border:0px solid">
<br><font size="1" face="sans-serif">Hall 25, booth no. 314
Hall A3, booth
no. D3.001</font>
<br><font size="1" face="sans-serif">September 20 - 23, 2016
October 11 -
13, 2016</font>
<br><font size="1" face="sans-serif">Berlin, Germany
Hamburg, Germany</font><br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Unpaid intern in BillsBasement at noware dot com<br></div>
</div>