Closed Bug 674494 Opened 8 years ago Closed 8 years ago

Uninitialised variable in ThebesLayerBuffer causes incorrect marking of mDidSelfCopy flag

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: cwiiis, Assigned: cwiiis)

Details

(Whiteboard: [inbound])

Attachments

(1 file, 3 obsolete files)

At the beginning of ThebesLayerBuffer::BeginPaint, the returned 'PaintState' variable is uninitialised. As not all of its fields are set, this can cause the 'mDidSelfCopy' flag to be incorrectly marked.

Patch incoming...
Attachment #548739 - Flags: review?(matt.woodrow)
Sorry, another patch was accidentally combined.
Attachment #548739 - Attachment is obsolete: true
Attachment #548739 - Flags: review?(matt.woodrow)
Attachment #548742 - Flags: review?(matt.woodrow)
I think I'd rather add a constructor to set mDidSelfCopy to false, good catch though
Updated patch that uses a constructor.
Attachment #548742 - Attachment is obsolete: true
Attachment #548742 - Flags: review?(matt.woodrow)
Attachment #552323 - Flags: review?(matt.woodrow)
Assignee: nobody → chrislord.net
Comment on attachment 552323 [details] [diff] [review]
Fix uninitialised PaintState return variable by adding a constructor

Review of attachment 552323 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/ThebesLayerBuffer.h
@@ +114,5 @@
>    struct PaintState {
> +    PaintState()
> +      : mContext(nsnull)
> +      , mRegionToDraw()
> +      , mRegionToInvalidate()

You shouldn't need to explicitly construct these 3, they should all default to the correct values.
Attachment #552323 - Flags: review?(matt.woodrow) → review+
Assuming this is good to go, could you push? I don't have L3 access yet.
Attachment #552323 - Attachment is obsolete: true
Attachment #553142 - Flags: review?(matt.woodrow)
Comment on attachment 553142 [details] [diff] [review]
Fix uninitialised PaintState return variable by adding a constructor (final?)

Looks good!

I'll land this on incoming this afternoon.
Attachment #553142 - Flags: review?(matt.woodrow) → review+
http://hg.mozilla.org/mozilla-central/rev/f345becaf55b
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.