Closed Bug 1117594 Opened 8 years ago Closed 8 years ago

|technique| can be used when uninitialized in ImageLayerD3D10::RenderLayer()

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(1 file)

cppcheck reports this:

> gfx/layers/d3d10/ImageLayerD3D10.cpp:313: error: Uninitialized variable: technique

If image->GetFormat() is one of CAIRO_SURFACE, D3D9_RGB32_TEXTURE or PLANAR_YCBCR then |technique| will be initialized. Otherwise, it won't be.

I see two possibilities:

- This is a real defect.

- This is not a real defect because the three above are the only possible values. If so, it would be good to add an |else| branch that crashes, or something like that, to make things clearer. Especially given that this is a large function with complex control flow.

I've marked this bug as security-sensitive to be cautious, but that may be overkill.
bas, what do you think? Is it a real defect?
Flags: needinfo?(bas)
(In reply to Nicholas Nethercote [:njn] from comment #1)
> bas, what do you think? Is it a real defect?

Off the top of my head these are the only possible options. But it would probably be good to assert this or even as you suggested MOZ_CRASH. Especially in case someone changes this in the future.
Flags: needinfo?(bas)
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
This bug probably doesn't need the s-s tag any more, but I don't have permission to remove it.
Group: core-security
Attachment #8543742 - Flags: review?(bas) → review+
https://hg.mozilla.org/mozilla-central/rev/03a624fda816
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.