Closed Bug 293558 Opened 20 years ago Closed 20 years ago

CairoGradient can use an uninitialized |gradient|

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: scootermorris)

Details

Attachments

(1 file, 1 obsolete file)

The build warning is:

../../../../../../mozilla/layout/svg/renderer/src/cairo/nsSVGCairoGradient.cpp:142:
warning: `
   cairo_pattern_t*gradient' might be used uninitialized in this function

For once, gdb is right.  The gradient frame will return
nsISVGGradient::SVG_UNKNOWN_GRADIENT in some cases, and then we'll never init
|gradient| in this method.

To test, try an XBL binding that extends svg:linearGradient...  That will get a
gradient frame, I believe.  In any case, we should just bail out on unknown
gradient type.
Assignee: general → scootermorris
Status: NEW → ASSIGNED
Attachment #183188 - Flags: review?(tor)
Attachment #183188 - Flags: review?(tor)
Attachment #183189 - Flags: review?(tor) → review+
Attachment #183189 - Flags: approval1.8b2?
Comment on attachment 183189 [details] [diff] [review]
Just return if we're not a linear or radial gradient (without extra assignment)

a=shaver
Attachment #183189 - Flags: approval1.8b2? → approval1.8b2+
Checked in for scooter.

Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: