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

Hotfix - fix integer overflow bug in sits_classify() segments #1046

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sits
Type: Package
Version: 1.4.2-1
Version: 1.4.2-2
Title: Satellite Image Time Series Analysis for Earth Observation Data Cubes
Authors@R: c(person('Rolf', 'Simoes', role = c('aut'), email = '[email protected]'),
person('Gilberto', 'Camara', role = c('aut', 'cre'), email = '[email protected]'),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# What's new in SITS version 1.4

### Hotfix version 1.4.2-2
* Fix integer overflow bug in `sits_classify()` segments

### Hotfix version 1.4.2-1
* Fix crs bug in `sits_apply()`
* Update file name in clean feature
Expand Down
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