Skip to content

Commit bfde5cd

Browse files
committed
SGBM: fixed uninitialized memory in cost buffer
1 parent 7d5fd6a commit bfde5cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/calib3d/src/stereosgbm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static void computeDisparitySGBM( const Mat& img1, const Mat& img2,
366366
PixType* tempBuf = (PixType*)(disp2ptr + width);
367367

368368
// add P2 to every C(x,y). it saves a few operations in the inner loops
369-
for( k = 0; k < width1*D; k++ )
369+
for(k = 0; k < (int)CSBufSize; k++ )
370370
Cbuf[k] = (CostType)P2;
371371

372372
for( int pass = 1; pass <= npasses; pass++ )

0 commit comments

Comments
 (0)