Commit e90a9e81 authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1612 from alalek:ocl_fix_string_info

parents ae56eaa5 f617c0d4
...@@ -97,13 +97,14 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string ...@@ -97,13 +97,14 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
if (err != CL_SUCCESS) if (err != CL_SUCCESS)
return err; return err;
param.resize(required); param.clear();
if (required > 0) if (required > 0)
{ {
err = f(obj, name, required, &param.at(0), NULL); std::vector<char> buf(required + 1, char(0));
err = f(obj, name, required, &buf[0], NULL);
if (err != CL_SUCCESS) if (err != CL_SUCCESS)
return err; return err;
param.resize(required - 1); // last symbol is '\0' param = &buf[0];
} }
return CL_SUCCESS; return CL_SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment