Closed
Bug 1242421
Opened 9 years ago
Closed 9 years ago
[Static Analysis][Dereference before null check] In function DrawTargetCairo::FillGlyphs from DrawTargetCairo.cpp
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1349972 )
Attachments
(1 file)
The Static Analysis tool Coverity added that variable mContext is null checked here:
>> if (mContext && cairo_surface_status(cairo_get_group_target(mContext))) {
>> gfxDebug() << "Ending FillGlyphs with a bad surface " << cairo_surface_status(cairo_get_group_target(mContext));
>> }
Even though it's dereferenced earlier in the function. This checker is a false positive since we know for sure that at this step of the execution mContext has already been
created by the stack path:
>> -> mozilla::gfx::DrawTargetCairo::InitAlreadyReferenced
>> mozilla::gfx::DrawTargetCairo::Init
>> mozilla::gfx::Factory::CreateDrawTargetForCairoSurface
>> gfxPlatform::CreateDrawTargetForSurface
So the null checker of mContext from FillGlyphs is useless.
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/32273/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32273/
Attachment #8711634 -
Flags: review?(roc)
Comment on attachment 8711634 [details]
MozReview Request: Bug 1242421 - remove useless null check. r?roc@ocallahan.org
https://reviewboard.mozilla.org/r/32273/#review28969
Attachment #8711634 -
Flags: review?(roc) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 4•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment 5•9 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•