Skip to content

Commit b45e784

Browse files
committed
Fix segmentation fault in cv::Mat::forEach
This issue concerns only matrices with more dimensions than columns. See opencv#8447
1 parent f70cc29 commit b45e784

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/core/include/opencv2/core/utility.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ void Mat::forEach_impl(const Functor& operation) {
507507
this->rowCall2(row, COLS);
508508
}
509509
} else {
510-
std::vector<int> idx(COLS); /// idx is modified in this->rowCall
510+
std::vector<int> idx(DIMS); /// idx is modified in this->rowCall
511511
idx[DIMS - 2] = range.start - 1;
512512

513513
for (int line_num = range.start; line_num < range.end; ++line_num) {

0 commit comments

Comments
 (0)