Skip to content

Commit 4fb2831

Browse files
committed
BUG: Address divide by zero error in SignedMaurerDistance
1 parent 3ecf6c8 commit 4fb2831

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/Filtering/ImageLabel/include/itkBinaryContourImageFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ BinaryContourImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData(
109109
RegionType reqRegion = output->GetRequestedRegion();
110110
SizeValueType pixelcount = reqRegion.GetNumberOfPixels();
111111
SizeValueType xsize = reqRegion.GetSize()[0];
112-
SizeValueType linecount = pixelcount / xsize;
112+
const SizeValueType linecount = (xsize > 0 ? pixelcount / xsize : 0);
113113

114114
m_ForegroundLineMap.clear();
115115
m_ForegroundLineMap.resize(linecount);

0 commit comments

Comments
 (0)