From 77327a03904ad7d6f58b07ec698cd15f02a4d6fa Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 29 Apr 2016 20:10:18 +0100 Subject: coverity#1358843 Argument cannot be negative Change-Id: I97911406d55464f042922a2e37b33f92e2c024ef --- opencl/source/opencl_device.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opencl') diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index 907d551b8a69..db143e3dcff1 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -435,7 +435,7 @@ ds_status pickBestDevice(std::unique_ptr& 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)."); } -- cgit