From: Sergey Sharybin <sergey.vfx@gmail.com>
Date: Wed, 15 Oct 2014 09:20:38 +0200
Subject: use_cuda_pointer_arithmetic_in_integers

This should hopefully fix #765187

Signed-off-by: Matteo F. Vescovi <mfvescovi@gmail.com>
---
 intern/cycles/device/device_cuda.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 5de2efa..967a260 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -355,7 +355,7 @@ public:
 		cuda_push_context();
 		if(mem.device_pointer) {
 			cuda_assert(cuMemcpyDtoH((uchar*)mem.data_pointer + offset,
-			                         (CUdeviceptr)((uchar*)mem.device_pointer + offset), size));
+			                         (CUdeviceptr)(mem.device_pointer + offset), size));
 		}
 		else {
 			memset((char*)mem.data_pointer + offset, 0, size);
