[arrayfire] 209/248: Fix af_device_array dims check

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 7ad94e51deeea54133b113a544c52325ae016293
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Fri Nov 6 10:30:05 2015 -0500

    Fix af_device_array dims check
---
 src/api/c/device.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/api/c/device.cpp b/src/api/c/device.cpp
index 80b8733..85c1795 100644
--- a/src/api/c/device.cpp
+++ b/src/api/c/device.cpp
@@ -144,9 +144,12 @@ af_err af_device_array(af_array *arr, const void *data,
         AF_CHECK(af_init());
 
         af_array res;
-        af::dim4 d((size_t)dims[0]);
-        for(unsigned i = 1; i < ndims; i++) {
+
+        DIM_ASSERT(1, ndims >= 1);
+        dim4 d(1, 1, 1, 1);
+        for(unsigned i = 0; i < ndims; i++) {
             d[i] = dims[i];
+            DIM_ASSERT(3, dims[i] >= 1);
         }
 
         switch (type) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list