coverity#1358843 Argument cannot be negative

Change-Id: I97911406d55464f042922a2e37b33f92e2c024ef
This commit is contained in:
Caolán McNamara
2016-04-29 20:10:18 +01:00
parent 7739bd5f54
commit 77327a0390

View File

@@ -435,7 +435,7 @@ ds_status pickBestDevice(std::unique_ptr<ds_profile>& profile, int& rBestDeviceI
rBestDeviceIndex = d;
}
}
if (profile->devices[rBestDeviceIndex].eType == DeviceType::OpenCLDevice)
if (rBestDeviceIndex != -1 && profile->devices[rBestDeviceIndex].eType == DeviceType::OpenCLDevice)
{
SAL_INFO("opencl.device", "Selected Device[" << rBestDeviceIndex << "]: " << profile->devices[rBestDeviceIndex].sDeviceName << "(OpenCL).");
}