Closed Bug 330602 Opened 19 years ago Closed 19 years ago

Crash with textPath text going off end of path

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tor, Assigned: tor)

References

Details

Attachments

(2 files, 4 obsolete files)

On linux sometimes the branch with textPath (bug 327539) crashes inside cairo, with the textcase on bug 306547. This appears to be caused by us trying to do operations on characters that fall off the end of the path. Handing NaN as the position/angle causes an invalid scale matrix to be set, which then messes up the font backend.
Attached patch branch patch (obsolete) — Splinter Review
Attachment #215155 - Flags: review?(longsonr)
Attached patch trunk patch (obsolete) — Splinter Review
Attachment #215156 - Flags: review?(longsonr)
Attachment #215155 - Attachment is obsolete: true
Attachment #215155 - Flags: review?(longsonr)
Attachment #215156 - Attachment is obsolete: true
Attachment #215156 - Flags: review?(longsonr)
Attachment #215162 - Flags: review?(longsonr)
Attachment #215163 - Flags: review?(longsonr)
Comment on attachment 215163 [details] [diff] [review] trunk patch - allow for text spill off start and end of path Branch and Trunk... Calls to cairo_get_matrix have a corresponding cairo_set_matrix except with the change to nsSVGCairoGlyphGeometry::ContainsPoint. Do we need to ensure this continues to be so? In which case the cairo_get_matrix call could be moved (and duplicated so that it occurs within the if (after the draw test) and in the else. Trunk only... nsSVGCairoGlyphMetrics::GetCharNumAtPosition We should not give up and return an error if cp[charnum].draw is FALSE, merely ignore this character (using continue) and presumably carry on to check the next character. May need to restructure things a little to ensure cairo_get_matrix and cairo_set_matrix calls still balance assuming the first comment is correct.
Attachment #215163 - Flags: review?(longsonr) → review-
Or alternatively stick a call to cairo_set_matrix if draw is FALSE before the continue where appropriate
It's safe to call cairo_get_matrix() unbalanced, as it doesn't change the state of the cairo content. However I've adjusted the logic to avoid that.
Attachment #215163 - Attachment is obsolete: true
Attachment #215260 - Flags: review?(longsonr)
Comment on attachment 215260 [details] [diff] [review] trunk patch - adjusted per comments What do you want to do about the branch patch? I guess you can fix it up when you check it in if you want.
Attachment #215260 - Flags: review?(longsonr) → review+
Attachment #215162 - Attachment is obsolete: true
Attachment #215275 - Flags: superreview?(roc)
Attachment #215275 - Flags: review?(longsonr)
Attachment #215162 - Flags: review?(longsonr)
Attachment #215260 - Flags: superreview?(roc)
Attachment #215275 - Flags: review?(longsonr) → review+
Attachment #215275 - Flags: superreview?(roc) → superreview+
Attachment #215260 - Flags: superreview?(roc) → superreview+
Checked in.
Status: NEW → RESOLVED
Closed: 19 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: