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
parent b57526185d
commit b9a3098830
No known key found for this signature in database
GPG key ID: 0918EC276CE143EC

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;