Closed Bug 1299438 Opened 3 years ago Closed 3 years ago

[Static Analysis][Unchecked return value] In function SVGTextFrame::TransformFrameRectFromTextChild

Categories

(Core :: SVG, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1372284)

Attachments

(1 file)

The Static Analysis tool Coverity detected that the return value of the followin statement is not checked:

>>5624    rectInFrameUserSpace.IntersectRect
>>5625      (rectInFrameUserSpace, run.GetFrameUserSpaceRect(presContext, >>flags).ToThebesRect());
>>5626
>>5627    if (!rectInFrameUserSpace.IsEmpty()) {

In this context isEmpty is called two times, first time in as the return function in IntersectRect and the second time in if statement.

What i propose is moving the call of rectInFrameUserSpace.IntersectRect is the if statement thus avoiding calling two times isEmpty
Attachment #8786714 - Flags: review?(longsonr) → review+
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f01400430d49
avoid calling multiple times isEmpty. r=longsonr
https://hg.mozilla.org/mozilla-central/rev/f01400430d49
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.