1
0
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:
Alexander Alekhin
2017-02-14 14:58:52 +03:00
parent 47ae5f14f5
commit 4c7aa8645a
4 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -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 )