Open Bug 2089961 Opened 13 days ago

Remove the dead !mContext check in DrawTargetCairo::ClearRect

Categories

(Core :: Graphics, task)

task

Tracking

()

People

(Reporter: Sylvestre, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=c++])

Filing as a good first bug to learn workflows.

DrawTargetCairo::ClearRect returns early when !IsValid(), and IsValid() already requires mContext, so the !mContext || in the warning condition below is dead. Drop it.

Current code:


  if (!mContext || aRect.Width() < 0 || aRect.Height() < 0 ||
      !std::isfinite(aRect.X()) || !std::isfinite(aRect.Width()) ||

Link to the code:
https://searchfox.org/firefox-main/source/gfx/2d/DrawTargetCairo.cpp

To verify the fix:

./mach build

This was reported by Coverity Scan (CID 1323117). The analyzer will stop reporting it once the change lands.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.