Closed Bug 317513 Opened 19 years ago Closed 19 years ago

Bug in nsRegion::SubRect causes incorrect results

Categories

(Core Graveyard :: GFX, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

Details

Attachments

(1 file)

If you pass a rect to nsRegion::SubRect that's in the region's rectangle list, we copy it to the result region by mistake. The net result is that for complex regions X, Sub(X,X) gives you X, not the empty region.

I don't know why it took us this long to find...
Attached patch fixSplinter Review
See the comments. The code below the loop tries to copy all the remaining unscanned rects to the result region. But when we break out of the loop, this code copied the *current* rect too, which we don't want.
Attachment #204013 - Flags: superreview?(bzbarsky)
Attachment #204013 - Flags: review?
Attachment #204013 - Flags: review? → review?(Dainis_Jonitis)
Comment on attachment 204013 [details] [diff] [review]
fix

Yeah, that was my error :( Thanks for finding and fixing it!
Attachment #204013 - Flags: review?(Dainis_Jonitis) → review+
Comment on attachment 204013 [details] [diff] [review]
fix

sr=bzbarsky
Attachment #204013 - Flags: superreview?(bzbarsky) → superreview+
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: