summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opencl/inc/opencl_device_selection.h3
-rw-r--r--opencl/source/opencl_device.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h
index 6ec506dd0314..e2bda73af8f3 100644
--- a/opencl/inc/opencl_device_selection.h
+++ b/opencl/inc/opencl_device_selection.h
@@ -326,6 +326,9 @@ private:
public:
XmlWalker()
+ : mpDocPtr(nullptr)
+ , mpRoot(nullptr)
+ , mpCurrent(nullptr)
{}
~XmlWalker()
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index d70ea8180199..2acecdf25754 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -434,7 +434,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).");
}