Repository navigation
Fixed issues found by static analysis (mostly DBZ) - #11984
Merged
Merged
Conversation
alalek
reviewed
Jul 16, 2018
| _uu[2] = 1; | ||
| cvCrossProduct(&uu, &t, &ww); | ||
| nt = cvNorm(&t, 0, CV_L2); | ||
| CV_Assert(abs(nt) > 0); |
Member
There was a problem hiding this comment.
double nt, nw;
fabs() or std::abs()?
|
|
||
| Size sz = _src.getSz(); | ||
| int xtiles = (sz.width + TILE_SIZE-1)/TILE_SIZE; | ||
| int ytiles = (sz.height + TILE_SIZE-1)/TILE_SIZE; |
|
|
||
| int idxArg = kernel.set(0, ocl::KernelArg::PtrReadOnly(source)); | ||
| idxArg = kernel.set(idxArg, (int)source.step); | ||
| CV_Assert(source.elemSize() > 0); |
Member
There was a problem hiding this comment.
Well, may be add this assertion ("dbg" version) into .elemSize() methods directly?
alalek
reviewed
Jul 17, 2018
alalek
left a comment
Member
There was a problem hiding this comment.
BTW, UMat::setTo() with empty this crashes with enabled OpenCL.
| op == CMP_NE || op == CMP_GE || op == CMP_GT ); | ||
|
|
||
| if(_src1.empty() && _src2.empty()) | ||
| if(_src1.empty() || _src2.empty()) |
Member
There was a problem hiding this comment.
There is no sense to compare some non-empty Mat with empty other Mat.
if(_src1.empty() && _src2.empty())
{
dst.release();
return;
}
CV_Assert(!_src1.empty() && !_src2.empty());
I would just raise an error if some Mat is empty (see #8300).
| { | ||
| CV_INSTRUMENT_REGION() | ||
|
|
||
| if (empty()) return *this; |
| InputArray _param1arg, InputArray _param2arg, bool saturateRange ) | ||
| { | ||
| if (_mat.empty()) | ||
| return; |
Member
There was a problem hiding this comment.
The same.
There is no sense to allow processing of empty data.
alalek
approved these changes
Jul 17, 2018
opencv-pushbot
pushed a commit
that referenced
this pull request
Jul 17, 2018
Merged
SavyaSanchi-Sharma
pushed a commit
to SavyaSanchi-Sharma/opencv
that referenced
this pull request
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pullrequest changes
Added more checks for zero before division