Skip to content

Commit

Permalink
BUG: Address divide by zero error in SignedMaurerDistance
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Sep 29, 2020
1 parent 3ecf6c8 commit 4fb2831
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ BinaryContourImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData(
RegionType reqRegion = output->GetRequestedRegion();
SizeValueType pixelcount = reqRegion.GetNumberOfPixels();
SizeValueType xsize = reqRegion.GetSize()[0];
SizeValueType linecount = pixelcount / xsize;
const SizeValueType linecount = (xsize > 0 ? pixelcount / xsize : 0);

m_ForegroundLineMap.clear();
m_ForegroundLineMap.resize(linecount);
Expand Down

0 comments on commit 4fb2831

Please sign in to comment.