<html><head><style data-externalstyle="true">
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
</style></head><body><div data-externalstyle="false" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:16px;"><div>I looked at the code, too. I agree with David Gobbi.</div><div> </div><div>Change the newLines to newPolys. Probably a copy/paste/forgot-to-change-variable-name error...</div><div> </div><div>Making it static would be a bonus, but not required in this particular instance to fix the problem at hand.</div><div> </div><div data-signatureblock="true"> </div> <div style="border-top-color: rgb(225, 225, 225); border-top-width: 1px; border-top-style: solid;"> <strong>From:</strong> David Gobbi<br> <strong>Sent:</strong> March 8, 2013 7:38 PM<br> <strong>To:</strong> Sean McBride<br> <strong>CC:</strong> vtk-developers@vtk.org<br> <strong>Subject:</strong> Re: [vtk-developers] Help with vtkImageDataGeometryFilter.cxx:250...<br> </div> <div> </div>Hi Sean,<br><br>The code should be:<br><br> newPolys->Allocate(newPolys->EstimateSize(numPolys,4));<br><br>I looked at EstimateSize(), it is an inline function that does not use "this".<br>So the generated inline code never actually dereferences a NULL.<br>It should be a static method, I suppose.<br><br> - David<br><br>On Fri, Mar 8, 2013 at 5:25 PM, Sean McBride <sean@rogue-research.com> wrote:<br>> Hi again!<br>><br>> clang's -fsanitize=null gives:<br>><br>> Filters/Geometry/vtkImageDataGeometryFilter.cxx:250:28: runtime error: member call on null pointer of type 'vtkCellArray'<br>><br>> on this line:<br>><br>> newPolys->Allocate(newLines->EstimateSize(numPolys,4));<br>><br>> Looking at the code, it does indeed seem that in the "case 2:" branch, 'newLines' is never set.<br>><br>> Frankly, I'm amazed this doesn't crash everywhere, all the time. But I even added an "assert(newLines)" and it definitely is null.<br>><br>> Not sure what the right fix is here though... anyone?<br>><br>> Thanks,<br>><br>> --<br>> ____________________________________________________________<br>> Sean McBride, B. Eng sean@rogue-research.com<br>> Rogue Research www.rogue-research.com<br>> Mac Software Developer Montréal, Québec, Canada<br>><br>><br>> _______________________________________________<br>> Powered by www.kitware.com<br>><br>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>><br>> Follow this link to subscribe/unsubscribe:<br>> http://www.vtk.org/mailman/listinfo/vtk-developers<br>><br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.vtk.org/mailman/listinfo/vtk-developers<br><br></div></body></html>