From 869ed8e18efc9ee602f45267776cd179c80ec3af Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 28 Dec 2019 18:51:39 +0100 Subject: transfer: slightly relax the domain overlap check Allow the destination domain to be outside the source by a small margin (1e-12). --- transfer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transfer.c b/transfer.c index ee635b9..a791467 100644 --- a/transfer.c +++ b/transfer.c @@ -481,7 +481,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; } -- cgit v1.2.3