Closed Bug 477961 Opened 11 years ago Closed 11 years ago

uninitialized memory read of nsCanvasRenderingContext2D::mLastStyle

Categories

(Core :: Canvas: 2D, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Keywords: valgrind)

Attachments

(1 file)

Attached patch patchSplinter Review
While running mochitests under valgrind (I think the canvas mochitests), I hit an uninitialized memory read of mLastStyle.

While I think the warning could be fixed by reversing the order of these checks in ApplyStyle:
    if (mLastStyle == aWhichStyle &&
        !mDirtyStyle[aWhichStyle] &&
it seems cleaner to just initialize mLastStyle.  This patch does so.
Attachment #361712 - Flags: review?(vladimir)
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Priority: -- → P5
Target Milestone: --- → mozilla1.9.2a1
Comment on attachment 361712 [details] [diff] [review]
patch

Yep, good catch.
Attachment #361712 - Flags: review?(vladimir) → review+
Keywords: valgrind
Flags: in-testsuite+
http://hg.mozilla.org/mozilla-central/rev/60a5db4c9429
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.