View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001455VTK(No Category)public2005-01-04 09:452011-01-13 17:00
ReporterJoris Van Zwieten 
Assigned ToMathieu Malaterre 
PrioritylowSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001455: Off by one bug in vtkImageExtractComponents
DescriptionIn function:
void vtkImageExtractComponents::ThreadedExecute()
(see http://public.kitware.com/cgi-bin/viewcvs.cgi/Imaging/vtkImageExtractComponents.cxx?rev=1.31&view=markup [^]
)

We find the following code:
---------
// make sure we can get all of the components.
max = inData->GetNumberOfScalarComponents();
for (idx = 0; idx < this->NumberOfComponents; ++idx)
    {
    if (this->Components[idx] > max)
      {
      vtkErrorMacro("Execute: Component " << this->Components[idx]
                    << " is not in input.");
      return;
      }
    }
---------
The check on max should be greater than _or equal_, because if a vtkImageData object has N scalar components, the maximum index is N-1, not N. Also, it might be wise to check for < zero as well.
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0001859)
Mathieu Malaterre (developer)
2005-01-06 11:09

Fixed in CVS. Thank you Joris.

$ cvs ci -m"BUG: Fix Bug 0001455 - Off by one bug in vtkImageExtractComponents. Thanks to Joris van Zwieten for patch" vtkImageExtractComponents.cxx
/cvsroot/VTK/VTK/Imaging/vtkImageExtractComponents.cxx,v <-- vtkImageExtractComponents.cxx
new revision: 1.32; previous revision: 1.31

 Issue History
Date Modified Username Field Change
2010-11-29 17:59 Mathieu Malaterre Source_changeset_attached => VTK master fb5e6b5d
2011-01-13 17:00 Source_changeset_attached => VTK master a2bd8391
2011-01-13 17:00 Source_changeset_attached => VTK master 020ef709
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team