Bug in nsRegion::SubRect causes incorrect results

RESOLVED FIXED

Status

RESOLVED FIXED
13 years ago
10 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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...
Created attachment 204013 [details] [diff] [review]
fix

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 2

13 years ago
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
Last Resolved: 13 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.