From c0f56ad76680df555689d4a2397487ef8c16b1a6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 25 Jun 2015 14:00:31 -0700 Subject: [PATCH] More accurate checking for overlapped ranges. A RangeSet has half-closed half-open bounds. For example, "3,5" contains blocks 3 and 4. So "3,5" and "5,7" are actually not overlapped. Bug: 22098085 Change-Id: I75e54a6506f2a20255d782ee710e889fad2eaf29 --- updater/blockimg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updater/blockimg.c b/updater/blockimg.c index fc35abe4..0bd2559f 100644 --- a/updater/blockimg.c +++ b/updater/blockimg.c @@ -162,7 +162,7 @@ static int range_overlaps(RangeSet* r1, RangeSet* r2) { r2_0 = r2->pos[j * 2]; r2_1 = r2->pos[j * 2 + 1]; - if (!(r2_0 > r1_1 || r1_0 > r2_1)) { + if (!(r2_0 >= r1_1 || r1_0 >= r2_1)) { return 1; } }