Skip to content

Commit

Permalink
Merge branch '48-fix_address_overflow' into 'master'
Browse files Browse the repository at this point in the history
Avoid address overflow

See merge request tech/adaskit/libSGM!63
  • Loading branch information
atakagi-fixstars committed Jul 24, 2023
2 parents c2c4d23 + 1d02314 commit e23afca
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 e23afca

Please sign in to comment.