Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes overflow when reading in large images #7677

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CGAL_ImageIO/include/CGAL/ImageIO_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ static void _swapImageData( _image *im )
Swap bytes depending on the endianness and the current architecture */
CGAL_INLINE_FUNCTION
int _readImageData(_image *im) {
unsigned long size, nread;
std::size_t size, nread;

if(im->openMode != OM_CLOSE) {
size = im->xdim * im->ydim * im->zdim * im->vdim * im->wdim;
Expand Down Expand Up @@ -1279,7 +1279,7 @@ int _readImageData(_image *im) {
Swap bytes depending on the endianness and the current architecture. */
CGAL_INLINE_FUNCTION
int _readNonInterlacedImageData(_image *im) {
unsigned long size, nread;
std::size_t size, nread;
unsigned char **vp, *buf;
unsigned int i, j, k, v, w;

Expand Down Expand Up @@ -1356,7 +1356,7 @@ int _readNonInterlacedImageData(_image *im) {
been read by _readImageHeader. The image buffer is interlaced. */
CGAL_INLINE_FUNCTION
int _readNonInterlacedFileData(_image *im) {
unsigned long size, nread;
std::size_t size, nread;
unsigned char *ptr1, *vp, *buf;
unsigned int i, j, k, v, w;

Expand Down