Closed Bug 396321 Opened 17 years ago Closed 17 years ago

"ASSERTION: Couldn't find glyph for trailing marker" with <svg:text>, RLE

Categories

(Core :: Graphics, defect, P1)

x86
macOS
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: roc)

References

Details

(Keywords: assertion, crash, testcase, Whiteboard: [sg:critical])

Attachments

(2 files)

Attached image testcase
Loading the testcase triggers this assertion, at least the first time it's loaded in a session:

###!!! ASSERTION: Couldn't find glyph for trailing marker: 'glyphRecords[numGlyphs - 1].originalOffset == aSegmentLength*2', file /Users/jruderman/trunk/mozilla/gfx/thebes/src/gfxAtsuiFonts.cpp, line 865

With a testcase more complicated than the one I'm attaching, this leads to a crash that looks exploitable.

I'm testing with the patch from bug 395458 comment 3.
Flags: blocking1.9?
Whiteboard: [sg:critical]
The text-frame code strips IsDiscardable characters before creating a textrun with them; looks like SVG needs to, too:

http://mxr.mozilla.org/seamonkey/source/layout/generic/nsTextFrameUtils.cpp#73

I suppose I could add these to gfxFontGroup::IsInvalidChar, though, which would fix this. Guess I'll do that.
Assignee: nobody → roc
Flags: blocking1.9? → blocking1.9+
I need the patch in bug 395458 to land first because it will conflict with this one.
Depends on: 395458
Whiteboard: [sg:critical] → [sg:critical] [depends on 395458]
Priority: -- → P1
Whiteboard: [sg:critical] [depends on 395458] → [sg:critical]
Attached patch fixSplinter Review
Just make bidi control characters illegal to be passed to MakeTextRun. gfxTextRunWordCache (which SVG and all other textrun consumers use) will filter them automatically.
Attachment #285958 - Flags: review?(pavlov)
Whiteboard: [sg:critical] → [sg:critical][needs review]
Comment on attachment 285958 [details] [diff] [review]
fix

this is fine -- imho unicharutil should live near the bottom of the dependency stack.

that said, nsBidiUtils.h shouldn't include nsCOMPtr.h
Attachment #285958 - Flags: review?(pavlov) → review+
Attachment #285958 - Flags: approvalM9?
Whiteboard: [sg:critical][needs review] → [sg:critical][needs approval/landing]
Comment on attachment 285958 [details] [diff] [review]
fix

a=drivers, please land ASAP for M9
Attachment #285958 - Flags: approvalM9?
Attachment #285958 - Flags: approvalM9+
Attachment #285958 - Flags: approval1.9+
checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [sg:critical][needs approval/landing] → [sg:critical]
Flags: in-testsuite?
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3pre) Gecko/2008011009 Firefox/3.0b3pre ID:2008011009 and the testcase from jesse.

-> Verified fixed
Status: RESOLVED → VERIFIED
This bug doesn't seem to affect the 1.8 branch.
Group: security
Flags: wanted1.8.1.x-
Crashtest checked in.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: