[vtk-developers] Possible fix for vtkImageStencilData::InsertAndMergeExtent
Xabi Riobe
xabivtk at gmail.com
Fri Jul 31 04:30:29 EDT 2015
Hi David,
Thank you for your answer. For now i don't have a Mac to test anything, but
i will try to do something on monday or tuesday.
2015-07-30 19:18 GMT+02:00 David Gobbi <david.gobbi at gmail.com>:
> Hi Xabi,
>
> It doesn't look like the right fix, I suspect that the flaw in the logic
> is somewhere else in that method. Do you have any test code that I can use
> to reproduce the bug?
>
> - David
>
>
> On Thu, Jul 30, 2015 at 1:05 AM, Xabi Riobe <xabivtk at gmail.com> wrote:
>
>> Hi,
>>
>> I'm in the process of migrating from 5.10.1 to 6.3 and have found a fix i
>> had in vtkImageStencilData::InsertAndMergeExtent from one year ago.
>>
>> at the end of the method there is this loop:
>>
>> while (r1 < clist[insertIndex-1])
>> {
>> clist[insertIndex] = clist[insertIndex-2];
>> clist[insertIndex+1] = clist[insertIndex-1];
>> insertIndex -= 2;
>> }
>>
>> and i have this line added : if (insertIndex <= 1) break;
>> with the comment: "avoid accessing out of range elements, which produces
>> incorrect stencil that causes a random crash later when used in
>> vtkImageStencilExecute"
>>
>> This random crash occured on Mac, never reproduced on Windows.
>>
>> I was wondering if by looking at the code you think it's a correct fix
>> that can be merged.
>>
>> Thanks
>>
>> Xabi.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150731/5cb7abc4/attachment.html>
More information about the vtk-developers
mailing list