From bd8966b9d011802d7810a6b1967a977158594cb2 Mon Sep 17 00:00:00 2001 From: "akihiro.takagi" Date: Thu, 10 Aug 2023 11:31:27 +0900 Subject: [PATCH] Avoid address overflow (HostImage) --- test/host_image.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/host_image.h b/test/host_image.h index 83a068f..5423a06 100644 --- a/test/host_image.h +++ b/test/host_image.h @@ -94,8 +94,8 @@ class HostImage memcpy(rhs.data, data, elemSize(type) * rows * step); } - template T* ptr(int y = 0) { return (T*)data + y * step; } - template const T* ptr(int y = 0) const { return (T*)data + y * step; } + template T* ptr(int y = 0) { return (T*)data + y * (size_t)step; } + template const T* ptr(int y = 0) const { return (T*)data + y * (size_t)step; } void* data; int rows, cols, step;