Skip to content

Commit 7908cee

Browse files
author
Antonios Makropoulos
committed
fix out of bounds error
1 parent 562e7de commit 7908cee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/DrawEM.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,16 +840,16 @@ void DrawEM::huiPVCorrection(bool changePosterior){
840840

841841

842842

843-
843+
int comp;
844844
for( int x = 0; x < _input.GetX(); ++x)
845845
{
846846
for( int y = 0; y < _input.GetY(); ++y)
847847
{
848848
for( int z = 0; z < _input.GetZ(); ++z)
849849
{
850850

851-
int comp=scc.Get(x,y,z)-1;
852-
wmvol[comp]++;
851+
comp=scc.Get(x,y,z)-1;
852+
if (comp >= 0) wmvol[comp]++;
853853

854854
comp= csfscc.Get(x,y,z)-1;
855855

0 commit comments

Comments
 (0)