Skip to content

BUG: prevent crash when TransformFileReader transform list is empty#40

Closed
ihnorton wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
ihnorton:prevent_matfile_reader_crash
Closed

BUG: prevent crash when TransformFileReader transform list is empty#40
ihnorton wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
ihnorton:prevent_matfile_reader_crash

Conversation

@ihnorton
Copy link
Copy Markdown
Contributor

@ihnorton ihnorton commented Mar 2, 2018

Fixes segfault reported here: https://discourse.slicer.org/t/loading-mat-matrix/2226
while reading MATLAB .mat file (into Slicer, but replicated independently) because ioTransformList is empty.

frame #0: 0x00000001148d4209 libITKIOTransformBase-4.13d.1.dylib`itk::TransformFileReaderTemplate<double>::Update(this=0x0000000146741000) at itkTransformFileReader.hxx:149
   146 	  // need to be initialized using the transform parameters.
   147 	  // kernelTransform->ComputeWMatrix() has to be called after the transform is read but
   148 	  // before the transform is used.
-> 149 	  std::string transformTypeName = ioTransformList.front()->GetNameOfClass();
   150 	  const size_t len = strlen("KernelTransform");// Computed at compile time in most cases
   151 	  if (transformTypeName.size() >= len
   152 	      && !transformTypeName.compare(transformTypeName.size()-len , len, "KernelTransform"))

@ihnorton
Copy link
Copy Markdown
Contributor Author

ihnorton commented Mar 2, 2018

FWIW

100% tests passed, 0 tests failed out of 2360

I guess CI failed due to compiler warnings.

@thewtex
Copy link
Copy Markdown
Member

thewtex commented Mar 5, 2018

@ihnorton Thanks for the patch. Could it please be submitted to Gerrit?

@ihnorton
Copy link
Copy Markdown
Contributor Author

ihnorton commented Mar 5, 2018

Alright... (I thought you were taking PRs based on some of the othere recent ones here)

@ihnorton ihnorton closed this Mar 5, 2018
@ihnorton ihnorton deleted the prevent_matfile_reader_crash branch March 5, 2018 17:37
@ihnorton
Copy link
Copy Markdown
Contributor Author

ihnorton commented Mar 5, 2018

@thewtex
Copy link
Copy Markdown
Member

thewtex commented Mar 6, 2018

Thanks, @ihnorton!

hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
Delta (4 commits):
  7b3eb67 (origin/main, origin/HEAD) Merge pull request InsightSoftwareConsortium#40 from InsightSoftwareConsortium/update-ci-best-practices
  b0cefba (HEAD -> update-ci-best-practices, origin/update-ci-best-practices) COMP: Pin ITK wheel build to v5.4.5 for Python packaging
  2bdb302 COMP: Update ITKRemoteModuleBuildTestPackageAction to v5.4.6
  106c649 COMP: Update minimum Python version to 3.10+

Preparatory step for ingesting ITKAnalyzeObjectLabelMap as an inline beta module
under Modules/Beta/AnalyzeObjectLabelMap/.
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…a-type

ENH: Support distinct CellData pixel type
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…s_autofix_ci-itk-5.4.0-secret-syntax

ENH: Upgrade CI for ITK 5.4.0
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
…onsortium/update-ci-best-practices

COMP: Update CI best practices and Python 3.10+
hjmjohnson pushed a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Apr 19, 2026
Delta (4 commits):
  7b3eb67 (origin/main, origin/HEAD) Merge pull request InsightSoftwareConsortium#40 from InsightSoftwareConsortium/update-ci-best-practices
  b0cefba (HEAD -> update-ci-best-practices, origin/update-ci-best-practices) COMP: Pin ITK wheel build to v5.4.5 for Python packaging
  2bdb302 COMP: Update ITKRemoteModuleBuildTestPackageAction to v5.4.6
  106c649 COMP: Update minimum Python version to 3.10+

Preparatory step for ingesting ITKAnalyzeObjectLabelMap as an inline beta module
under Modules/Beta/AnalyzeObjectLabelMap/.
hjmjohnson pushed a commit that referenced this pull request Apr 25, 2026
Adding initial montaging class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants