summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-12-28 18:51:39 +0100
committerAnton Khirnov <anton@khirnov.net>2020-01-02 14:13:34 +0100
commitd95492a6eefc35868065fd0685b119c0e683f7d2 (patch)
tree0f79ea63cfb21035a4f6adf49ba43dc2452d9e69
parentd3ad0d357e5586fcf21018f85bc8afc9d317ea79 (diff)
transfer: slightly relax the domain overlap check
Allow the destination domain to be outside the source by a small margin (1e-12).
-rw-r--r--transfer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/transfer.c b/transfer.c
index a43c596..01b9efc 100644
--- a/transfer.c
+++ b/transfer.c
@@ -482,7 +482,9 @@ int mg2di_gt_init(GridTransferContext *ctx)
dst_start = ctx->dst.start[i] * ctx->dst.step[i];
dst_end = (ctx->dst.start[i] + ctx->dst.size[i] - 1) * ctx->dst.step[i];
- if (src_start >= src_end || dst_start < src_start || dst_end > src_end)
+ if (src_start >= src_end ||
+ dst_start - src_start < -1e-12 ||
+ src_end - dst_end < -1e-12)
return -EINVAL;
}