File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
algorithms/include/gdx/algo Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,19 @@ template <typename RasterType, typename MaskType>
3131template <typename RasterType, typename MaskType>
3232void erase_outside_mask (RasterType& ras, const MaskType& mask)
3333{
34- int size = int ( mask.size () );
34+ auto size = mask.size ();
3535 if (size != ras.size ()) {
3636 throw InvalidArgument (" erase outside mask : size of mask {} should match size of raster {}" , size, ras.size ());
3737 }
3838 if (ras.nodata ().has_value ()) {
39- for (int32_t j = 0 ; j < size; ++j) {
39+ for (int32_t j = 0 ; j < inf::truncate< int32_t >( size) ; ++j) {
4040 if (mask[j] == 0 || mask.is_nodata (j)) {
4141 ras[j] = ras.NaN ;
4242 ras.mark_as_nodata (j);
4343 }
4444 }
4545 } else {
46- for (int32_t j = 0 ; j < size; ++j) {
46+ for (int32_t j = 0 ; j < inf::truncate< int32_t >( size) ; ++j) {
4747 if (mask[j] == 0 || mask.is_nodata (j)) {
4848 ras[j] = 0 ;
4949 }
You can’t perform that action at this time.
0 commit comments