Skip to content

Commit

Permalink
Merge pull request #1260 from kgoettler/fix-totalsize-calc-in-imagefi…
Browse files Browse the repository at this point in the history
…lter

fix(include): avoid segfault when calculating totalSize
  • Loading branch information
thewtex authored Oct 29, 2024
2 parents a56a471 + 7fe1b18 commit ee93c01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/itkWasmImageToImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,14 @@ WasmImageToImageFilter<TImage>
{
bufferedRegion.SetIndex(i, imageJSON.bufferedRegion.index[i]);
bufferedRegion.SetSize(i, imageJSON.bufferedRegion.size[i]);
totalSize *= imageJSON.bufferedRegion.size[i];
}
else
{
bufferedRegion.SetIndex(i, 0);
bufferedRegion.SetSize(i, imageJSON.size[i]);
totalSize *= imageJSON.size[i];
}
totalSize *= imageJSON.bufferedRegion.size[i];
largestRegion.SetSize(i, imageJSON.size[i]);
}
filter->SetBufferedRegion(bufferedRegion);
Expand Down

0 comments on commit ee93c01

Please sign in to comment.