View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008960ITKpublic2009-05-05 11:052010-11-07 01:57
ReporterLuis Ibanez 
Assigned ToLuis Ibanez 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0008960: Image Iterators do not validate region in constructor
DescriptionThe constructors of the ImageRegionConstIterator and ImageRegionConstIteratorWithIndex do not verify that the region passed as argument is fully contained in the image Buffered Region.
Additional InformationAs a result it is possible to pass as argument to the constructor, a region that is not inside of the image and to force the iterator to produce pointers that are outside of the image buffer.
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0016288)
Luis Ibanez (manager)
2009-05-05 11:07

Suggested patch:

Index: itkImageConstIterator.h
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/Common/itkImageConstIterator.h,v
retrieving revision 1.23
diff -r1.23 itkImageConstIterator.h
175a176,183
> const RegionType & bufferedRegion = m_Image->GetBufferedRegion();
>
> if( ! bufferedRegion.IsInside( m_Region ) )
> {
> itkGenericExceptionMacro("Region " << m_Region
> << " is outside of buffered region " << bufferedRegion );
> }
>
Index: itkImageConstIteratorWithIndex.txx
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/Common/itkImageConstIteratorWithIndex.txx,v
retrieving revision 1.27
diff -r1.27 itkImageConstIteratorWithIndex.txx
84a85,92
> const RegionType & bufferedRegion = m_Image->GetBufferedRegion();
>
> if( ! bufferedRegion.IsInside( m_Region ) )
> {
> itkGenericExceptionMacro("Region " << m_Region
> << " is outside of buffered region " << bufferedRegion );
> }
>
(0016289)
Luis Ibanez (manager)
2009-05-05 11:17

Discussion in the ITK Developers list.

http://www.itk.org/mailman/private/insight-developers/2009-May/012427.html [^]
(0022979)
Luis Ibanez (manager)
2010-11-07 01:57

The following expression is now in itkImageConstIterator.h
lines 175-180:

    if ( region.GetNumberOfPixels() > 0 ) // If region is non-empty
      {
      const RegionType & bufferedRegion = m_Image->GetBufferedRegion();
      itkAssertOrThrowMacro( ( bufferedRegion.IsInside(m_Region) ),
                             "Region " << m_Region << " is outside of buffered region " << bufferedRegion );
      }

 Issue History
Date Modified Username Field Change
2009-05-05 11:05 Luis Ibanez New Issue
2009-05-05 11:06 Luis Ibanez Summary ImageItartor doesn't validate region in constructor => Image Iterators do not validate region in constructor
2009-05-05 11:07 Luis Ibanez Note Added: 0016288
2009-05-05 11:17 Luis Ibanez Note Added: 0016289
2009-05-06 18:39 Luis Ibanez Status new => assigned
2009-05-06 18:39 Luis Ibanez Assigned To => Luis Ibanez
2010-11-07 01:57 Luis Ibanez Sprint Status => backlog
2010-11-07 01:57 Luis Ibanez Note Added: 0022979
2010-11-07 01:57 Luis Ibanez Status assigned => closed
2010-11-07 01:57 Luis Ibanez Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team