Closed Bug 648472 Opened 13 years ago Closed 13 years ago

[OS/2] avoid crashes when FcFontMatch() fails

Categories

(Core :: Graphics, defect)

x86
OS/2
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla5
Tracking Status
status2.0 --- .1-fixed

People

(Reporter: dragtext, Assigned: dragtext)

Details

Attachments

(1 file, 1 obsolete file)

Code in gfxOS2Fonts.cpp seems to assume that calls to FcFontMatch() will never fail, so it never checks the returned value.  Maybe it shouldn't, but I have numerous trap reports from users indicating that it does.

This patch provides a workaround until the underlying cause can be determined.  If FcFontMatch() fails for a given pattern, it reinvokes it asking for the default serif font (Times New Roman).  In general, this "shouldn't" fail.  The patch also adds checks for null pointers at appropriate points, and leaves a couple of debugging printf()'s active to help identify the problem.
Attached patch null font fix (obsolete) — Splinter Review
Attachment #524563 - Flags: review?(wuno)
Attachment #524563 - Flags: review?(wuno) → review+
Keywords: checkin-needed
Whiteboard: NPOTB, OS/2 file only
Assignee: nobody → dragtext
Status: NEW → ASSIGNED
In the future, please use these instructions <https://developer.mozilla.org/en/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3f> to generate your patches with the correct commit message and author information.  Thanks!
(In reply to comment #2)
> In the future, please use these instructions [...] to generate your patches
> with the correct commit message and author information.

Sorry.  The version in my patch queue had that but I forgot to copy the info when I recreated the patch with -u8 rather the queue's -u3.  The revised version has the info.

carrying over r+ from wuno
Attachment #524563 - Attachment is obsolete: true
Attachment #524908 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/57af1004637a
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: NPOTB, OS/2 file only
Target Milestone: --- → mozilla2.2
Keywords: checkin-needed
Whiteboard: mozilla-2.0 a=NPOTB OS/2 files only
http://hg.mozilla.org/releases/mozilla-2.0/rev/be7d2d8c53e3
Keywords: checkin-needed
Whiteboard: mozilla-2.0 a=NPOTB OS/2 files only
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: