Skip to content

Commit

Permalink
fix allocation large cubes - missed a proper size_t cast
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Jan 3, 2025
1 parent aa5f35b commit e629826
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/image/io/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
* 13-feb-13 V8.1 added region and sub_image() PJT
* 22-may-21 V8.2 deal with Object
* 19-mar-22 V8.3 deprecate Axis=0 images
* 17-dec-22 deal with Telescope/Object/Unit
* 17-dec-22 deal with Telescope/Object/Unit
* 2-jan-24 fix alloc large cubes
*
*
* Example of usage: see snapccd.c for writing
Expand Down Expand Up @@ -319,7 +320,9 @@ int read_image (stream instr, imageptr *iptr)

get_set (instr,MapTag);
if (Frame(*iptr)==NULL) { /* check if allocated */
nxyz = Nx(*iptr)*Ny(*iptr)*Nz(*iptr);
nxyz = Nx(*iptr);
nxyz *= Ny(*iptr);
nxyz *= Nz(*iptr);
Frame(*iptr) = (real *) allocate(nxyz * sizeof(real));
dprintf (DLEV,"Frame allocated @ %p ",Frame(*iptr));
} else
Expand Down

0 comments on commit e629826

Please sign in to comment.