From 6e19656e1196fc68feeb4f0122ba42a4b9101d24 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 27 Aug 2025 17:20:22 +0200 Subject: [PATCH] [gfx] Clarify comments. There may be other situations where putting a font entry in the cache table may fail that are perfectly valid. --- gfx/thebes/gfxFontEntry.cpp | 3 ++- gfx/thebes/gfxFontEntry.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index e8bb39e689..e07415983a 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -592,7 +592,8 @@ gfxFontEntry::ShareFontTableAndGetBlob(uint32_t aTag, } FontTableHashEntry *entry = mFontTableCache->PutEntry(aTag); - if (MOZ_UNLIKELY(!entry)) { // OOM + if (MOZ_UNLIKELY(!entry)) { + // OOM or other issue storing the entry. return nullptr; } diff --git a/gfx/thebes/gfxFontEntry.h b/gfx/thebes/gfxFontEntry.h index 162fe4f083..506c240270 100644 --- a/gfx/thebes/gfxFontEntry.h +++ b/gfx/thebes/gfxFontEntry.h @@ -265,7 +265,8 @@ public: // unregisters the table from the font entry. // // Pass nullptr for aBuffer to indicate that the table is not present and - // nullptr will be returned. Also returns nullptr on OOM. + // nullptr will be returned. Also returns nullptr on OOM or when there are + // other issues storing the entry in the cache table. hb_blob_t *ShareFontTableAndGetBlob(uint32_t aTag, nsTArray* aTable);