Skip to content

Commit

Permalink
fix integer overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
OldLipe committed Nov 28, 2023
1 parent 8e8b9e6 commit 16819bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/api_segments.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,10 @@
progress) {

# how much memory do we need?
req_memory <- .tile_nrows(tile) * .tile_ncols(tile) *
length(.tile_timeline(tile)) * length(bands) * 4 *
.conf("processing_bloat_seg") / 1e+09
# Get image size
req_memory <- .as_dbl(.tile_nrows(tile)) * .as_dbl(.tile_ncols(tile))
req_memory <- req_memory * length(.tile_timeline(tile)) *
length(bands) * 4 * .conf("processing_bloat_seg") / 1e+09

# do we have enough memory?
if (req_memory < memsize) {
Expand Down

0 comments on commit 16819bf

Please sign in to comment.