Skip to content

Commit dc7302e

Browse files
committed
[popsift] plane_2d: Use size_t type for memory size in bytes
Use size_t type to avoid short type overflow with large size images.
1 parent fb3c107 commit dc7302e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/popsift/common/plane_2d.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ template <typename T> struct PitchPlane2D : public PlaneT<T>
168168
PlaneBase::freeHost2D( this->data, mode );
169169
}
170170
__host__ __device__
171-
inline short getPitchInBytes( ) const { return _pitchInBytes; }
171+
inline size_t getPitchInBytes( ) const { return _pitchInBytes; }
172172

173173
protected:
174-
int _pitchInBytes; // pitch width in bytes
174+
size_t _pitchInBytes; // pitch width in bytes
175175
};
176176

177177
/*************************************************************
@@ -338,7 +338,7 @@ template <typename T> class Plane2D : public PitchPlane2D<T>
338338
__host__ __device__
339339
inline short getHeight( ) const { return _rows; }
340340
__host__ __device__
341-
inline short getByteSize( ) const { return this->_pitchInBytes*_rows; }
341+
inline size_t getByteSize( ) const { return this->_pitchInBytes * _rows; }
342342

343343
__host__ inline void allocDev( int w, int h ) {
344344
_cols = w;

0 commit comments

Comments
 (0)