diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index fcfb40816b..004b67c347 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -1026,8 +1026,8 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const { int sourcelinesize = GetBitmapData()->GetBytesPerRow() ; int destlinesize = ret.GetBitmapData()->GetBytesPerRow() ; - unsigned char *source = sourcedata + int(rect.x * scale * 4 + rect.y *scale * sourcelinesize) ; - unsigned char *dest = destdata ; + unsigned char* source = sourcedata + size_t(rect.x * scale) * 4 + size_t(rect.y * scale) * sourcelinesize; + unsigned char* dest = destdata; for (int yy = 0; yy < destheight; ++yy, source += sourcelinesize , dest += destlinesize) {