Open Bug 550943 Opened 10 years ago Updated 2 years ago

FontEntry::CairoFontFace doesn't handle failure from FT_New_Face

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set

Tracking

()

ASSIGNED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

222 FontEntry::CairoFontFace()

227         FT_Face face;
228         FT_New_Face(gfxToolkitPlatform::GetPlatform()->GetFTLibrary(), mFilename.get(), mFTFontIndex, &face);

everyone else handles failure from FT_New_Face
Attached patch proposalSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #431163 - Flags: review?(jfkthame)
Comment on attachment 431163 [details] [diff] [review]
proposal

Hmmm. Well, it's true that we ought to handle failure, but I'm not sure this gains us much, as we pass the return value of FontEntry::CairoFontFace() directly to cairo_scaled_font_create() at http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/src/gfxFT2Fonts.cpp#876, and that API is not documented as safely accepting NULL.

So rather than just checking at this callsite, I think we need to track where the resulting NULL goes and ensure that we handle the error safely at the higher levels as well.
Attachment #431163 - Flags: review?(jfkthame) → review-
ok
QA Contact: thebes → jdaggett
You need to log in before you can comment on or make changes to this bug.