From b3b27068806e53068f6cde4f092223c2cdb9d1fb Mon Sep 17 00:00:00 2001 From: William Bader Date: Mon, 28 Apr 2025 05:34:39 +0200 Subject: [PATCH] Add unlikely() to test for x == INT32_MAX for the NULL reference in https://gitlab.freedesktop.org/poppler/poppler/-/issues/1579 --- src/cairo-bentley-ottmann-rectangular.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c index be01e04f7..357d1a75f 100644 --- a/src/cairo-bentley-ottmann-rectangular.c +++ b/src/cairo-bentley-ottmann-rectangular.c @@ -847,8 +847,8 @@ _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in, rectangles[j].left.x = box[i].p2.x; rectangles[j].left.dir = -1; } - if (rectangles[j].left.x == INT32_MAX) rectangles[j].left.x = INT32_MAX-1; - if (rectangles[j].right.x == INT32_MAX) rectangles[j].right.x = INT32_MAX-1; + if (unlikely (rectangles[j].left.x == INT32_MAX)) rectangles[j].left.x = INT32_MAX-1; + if (unlikely (rectangles[j].right.x == INT32_MAX)) rectangles[j].right.x = INT32_MAX-1; rectangles[j].left.right = NULL; rectangles[j].right.right = NULL;