Closed Bug 2062207 Opened 2 months ago Closed 2 months ago

Fix big-endian correctness defects found by Coverity

Categories

(Core :: Graphics: Canvas2D, defect)

defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(2 external files)

Two endianness defects reported by Coverity. Neither affects the shipping little-endian tier, but both are wrong on big-endian targets.

  • CID 1459593 - dom/canvas/WebGLContextState.cpp: a 64-bit timestamp was read through a narrower type, so the wrong half was returned on big-endian.
  • CID 1690687 - gfx/2d/Swizzle.cpp: UnpackRowRGB24_To_ARGB packed the ARGB components in little-endian order unconditionally.

Filed under Core :: General because the fixes span Graphics: CanvasWebGL and Graphics

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Graphics: Canvas2D

On big-endian, the shifts placed red at bit 24 (colliding with the
0xFF000000 alpha constant) and mis-slotted green/blue. The A8R8G8B8
memory order requires (R << 16) | (G << 8) | B.

Assignee: nobody → sledru
Status: NEW → ASSIGNED

fGetIntegerv wrote a 32-bit GLint into the address of a uint64_t,
landing in the wrong half on big-endian. Read into a GLint temporary
and assign instead.

Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2678e723dabc https://hg.mozilla.org/integration/autoland/rev/7599a6127a50 Avoid endianness-dependent 64-bit timestamp read in WebGL GetParameter (Coverity CID 1459593) r=gfx-reviewers,lsalzman
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e1f3236895d0 https://hg.mozilla.org/integration/autoland/rev/9639c9ef7eb7 Fix big-endian ARGB packing in UnpackRowRGB24_To_ARGB (Coverity CID 1690687) r=gfx-reviewers,lsalzman
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: