Skip to content

Commit

Permalink
BUG: HDF5TransformIO throw exception instead of segfault
Browse files Browse the repository at this point in the history
With an empty input transform list.

Otherwise, `transformList.front()->GetTransformTypeAsString()` will segfault.
  • Loading branch information
thewtex authored and hjmjohnson committed Jun 26, 2024
1 parent 910f689 commit 1381ec4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ HDF5TransformIOTemplate<TParametersValueType>::Write()

ConstTransformListType & transformList = this->GetWriteTransformList();

if (transformList.empty())
{
itkExceptionMacro(<< "No transforms to write");
}
std::string compositeTransformType = transformList.front()->GetTransformTypeAsString();

CompositeTransformIOHelperTemplate<TParametersValueType> helper;
Expand Down

0 comments on commit 1381ec4

Please sign in to comment.