fixes for defects from code coverity

This commit is contained in:
Alexander Alekhin
2014-01-28 20:22:56 +04:00
parent fff5a6c058
commit 5474935a81
5 changed files with 8 additions and 7 deletions

View File

@@ -3673,6 +3673,7 @@ struct PlatformInfo2::Impl
{
Impl(void* id)
{
refcount = 1;
handle = *(cl_platform_id*)id;
getDevices(devices, handle);
}
@@ -3713,7 +3714,7 @@ int PlatformInfo2::deviceNumber() const
void PlatformInfo2::getDevice(Device& device, int d) const
{
CV_Assert(d < (int)p->devices.size() );
CV_Assert(p && d < (int)p->devices.size() );
if(p)
device.set(p->devices[d]);
}