Skip to content

Commit

Permalink
Avoid address overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
atakagi-fixstars committed Feb 3, 2023
1 parent c2c4d23 commit 1d02314
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/device_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class DeviceImage
void download(void* data) const;
void fill_zero();

template <typename T> T* ptr(int y = 0) { return (T*)data + y * step; }
template <typename T> const T* ptr(int y = 0) const { return (T*)data + y * step; }
template <typename T> T* ptr(int y = 0) { return (T*)data + y * (size_t)step; }
template <typename T> const T* ptr(int y = 0) const { return (T*)data + y * (size_t)step; }

void* data;
int rows, cols, step;
Expand Down

0 comments on commit 1d02314

Please sign in to comment.