_cairo_clip_reduce_to_boxes appears to have a merge bug; it returns early
Submitted by Arlie Davis
Assigned to Chris Wilson @ickle
Link to original bug (#104136)
Description
While reading code, I noticed that the function _cairo_clip_reduce_to_boxes appears to have an extra "return clip;" in it. This is the first (non-declaration) statement in the function, and so the function does nothing at all except for return the value of its input argument "clip". The code:
static cairo_clip_t * _cairo_clip_reduce_to_boxes (cairo_clip_t *clip) { struct reduce r; cairo_clip_path_t *clip_path; cairo_status_t status;
return clip; // <-- THIS LOOKS BOGUS
if (clip->path == NULL)
return clip;
r.clip = clip;
r.extents.p1.x = r.extents.p1.y = INT_MAX;
r.extents.p2.x = r.extents.p2.y = INT_MIN;
I checked the Git history, and this bug has been there from the first commit which added this file.