summaryrefslogtreecommitdiff
path: root/opencl/source/openclwrapper.cxx
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-05-13 19:58:18 +0800
committerTomaž Vajngerl <quikee@gmail.com>2016-06-06 10:34:07 +0000
commit40b0b9ab7703a165295b008f47df14d2ec076fb1 (patch)
treeec0e541957a6a1bb10b20273e5ad24ff26c6dca7 /opencl/source/openclwrapper.cxx
parent8b99402338773150fc0c8c6f894eb610e056d79e (diff)
Ensure that OpenCL device id returned from getDeviceSelection() is valid.
Change-Id: I756bb57d471db3d3ca1d9c3733d359c7c16b4e66 Reviewed-on: https://gerrit.libreoffice.org/24959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'opencl/source/openclwrapper.cxx')
-rw-r--r--opencl/source/openclwrapper.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index 1655cb61c84c..ab65091d3e66 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -703,6 +703,8 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv
OUString path;
osl::FileBase::getSystemPathFromFileURL(url,path);
ds_device aSelectedDevice = getDeviceSelection(path, bForceEvaluation);
+ if ( aSelectedDevice.eType != DeviceType::OpenCLDevice)
+ return false;
pDeviceId = aSelectedDevice.aDeviceID;
}