summaryrefslogtreecommitdiff
path: root/opencl/source/openclwrapper.cxx
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-05-13 19:58:18 +0800
committerCaolán McNamara <caolanm@redhat.com>2016-06-07 08:05:42 +0000
commit14c9f0aa3a242795de845c703ac0d47440053a56 (patch)
tree96e34e72b7334bccb47d5e101a0a60c1da9455d3 /opencl/source/openclwrapper.cxx
parentad049ffa1d3a22fac4864cae972690a1e46993c9 (diff)
Ensure that OpenCL device id returned from getDeviceSelection() is valid.cp-5.1-branch-point
Possible fix for tdf#100104 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> (cherry picked from commit 40b0b9ab7703a165295b008f47df14d2ec076fb1) Change-Id: I756bb57d471db3d3ca1d9c3733d359c7c16b4e66 Reviewed-on: https://gerrit.libreoffice.org/25964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'opencl/source/openclwrapper.cxx')
-rw-r--r--opencl/source/openclwrapper.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/opencl/source/openclwrapper.cxx b/opencl/source/openclwrapper.cxx
index e488f79fb8bc..8d57ae44e260 100644
--- a/opencl/source/openclwrapper.cxx
+++ b/opencl/source/openclwrapper.cxx
@@ -703,9 +703,10 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv
rtl::Bootstrap::expandMacros(url);
OUString path;
osl::FileBase::getSystemPathFromFileURL(url,path);
- ds_device pSelectedDevice = getDeviceSelection(path, bForceEvaluation);
- pDeviceId = pSelectedDevice.aDeviceID;
-
+ ds_device aSelectedDevice = getDeviceSelection(path, bForceEvaluation);
+ if ( aSelectedDevice.eType != DeviceType::OpenCLDevice)
+ return false;
+ pDeviceId = aSelectedDevice.aDeviceID;
}
if(gpuEnv.mpDevID == pDeviceId)