From d95492a6eefc35868065fd0685b119c0e683f7d2 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 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; } -- cgit v1.2.3