[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - opencl/inc opencl/source

Caolán McNamara caolanm at redhat.com
Wed May 18 11:38:15 UTC 2016


 opencl/inc/opencl_device_selection.h |    3 +++
 opencl/source/opencl_device.cxx      |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 853df7a5fa2b48f62a350c0e9eb1be3f6014dedc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 29 20:10:18 2016 +0100

    backport of opencl coverity fixes
    
    includes:
    coverity#1358843 Argument cannot be negative
    77327a03904ad7d6f58b07ec698cd15f02a4d6fa
    
    coverity#1358844 Uninitialized pointer field
    478a4032da69654245d478e15902feda1e49c84c
    
    Change-Id: I1a978106d2909169c5d10755ae88a69889d86274
    Reviewed-on: https://gerrit.libreoffice.org/24913
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h
index 6ec506d..e2bda73 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 d70ea81..2acecdf2 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).");
     }


More information about the Libreoffice-commits mailing list