mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 13:10:12 +08:00
Merge pull request #16992 from afowles:fix-forEach-segfault
* Fixed divide by zero error in forEach * Dedicated assertion for !empty
This commit is contained in:
parent
99d29c9d39
commit
8334932a26
@ -622,6 +622,7 @@ void Mat::forEach_impl(const Functor& operation) {
|
||||
// or (_Tp&, void*) <- in case you don't need current idx.
|
||||
}
|
||||
|
||||
CV_Assert(!empty());
|
||||
CV_Assert(this->total() / this->size[this->dims - 1] <= INT_MAX);
|
||||
const int LINES = static_cast<int>(this->total() / this->size[this->dims - 1]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user