mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
ocl: validate arguments in KernelArgs constructor
- don't use undefined flag=0. It should be CONSTANT instead. - don't allow 'UMat* m=NULL' argument (except LOCAL/CONSTANT flags). This case is not handled well to provide NULL __global pointers. It is better to use '-D' macro defines instead (at least for performance)
This commit is contained in:
@@ -986,7 +986,7 @@ UMat& UMat::setTo(InputArray _value, InputArray _mask)
|
||||
ocl::Kernel setK(haveMask ? "setMask" : "set", ocl::core::copyset_oclsrc, opts);
|
||||
if( !setK.empty() )
|
||||
{
|
||||
ocl::KernelArg scalararg(0, 0, 0, 0, buf, CV_ELEM_SIZE(d) * scalarcn);
|
||||
ocl::KernelArg scalararg(ocl::KernelArg::CONSTANT, 0, 0, 0, buf, CV_ELEM_SIZE(d) * scalarcn);
|
||||
UMat mask;
|
||||
|
||||
if( haveMask )
|
||||
|
||||
Reference in New Issue
Block a user