Add unlikely() to test for x == INT32_MAX for the NULL reference

in https://gitlab.freedesktop.org/poppler/poppler/-/issues/1579
This commit is contained in:
William Bader 2025-04-28 05:34:39 +02:00 committed by Uli Schlachter
parent 9aaa95f248
commit b3b2706880

View file

@ -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;