Closed Bug 1645482 Opened 5 years ago Closed 5 years ago

DirectWrite shared-font-list code may leak font table references

Categories

(Core :: Layout: Text and Fonts, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

If we fail to read font names using GetDirectWriteFaceName in the dwrite backend for the shared font list, we'll fall back to loading the 'name' table with TryGetFontTable and manually extracting names from it.

However, in a couple of places we then fail to release the font table reference, which could result in a leak. (It's possible this is unimportant in practice, if dwrite memory-maps the font file and hands us a constant reference to the mapped data, but we shouldn't assume this.)

Another (theoretical) bug is that in DirectWriteFontInfo::LoadFontFamilyData, we don't check the exists value returned by TryGetFontTable. This probably can't hurt us in practice, unless directwrite is on the verge of crashing due to resource exhaustion or something, as a font with no 'cmap' will never have been loaded at all, but for correctness we should include the check.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/239318854a0d Don't leak dwrite font table references after reading font names. r=jwatt
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: