Skip to content

Commit

Permalink
REGRESSION(274689@main): [GTK][Debug] Triggers assert on WOFF2 tests
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270414

Reviewed by Michael Catanzaro.

The convertWOFFToSfntIfNecessary() function can set the buffer to nullptr, specially if the
woff2::ConvertWOFF2ToTTF() call in convertWOFFToSfnt() fails. This patch re-introduces the buffer
check that was removed in 274689@main.

* Source/WebCore/loader/cache/CachedFont.cpp:
(WebCore::CachedFont::createCustomFontData):

Canonical link: https://commits.webkit.org/275617@main
  • Loading branch information
philn committed Mar 4, 2024
1 parent 3850dd4 commit 81bff4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebCore/loader/cache/CachedFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ RefPtr<FontCustomPlatformData> CachedFont::createCustomFontData(SharedBuffer& by
{
RefPtr buffer = { &bytes };
wrapping = !convertWOFFToSfntIfNecessary(buffer);
return FontCustomPlatformData::create(*buffer, itemInCollection);
return buffer ? FontCustomPlatformData::create(*buffer, itemInCollection) : nullptr;
}

RefPtr<FontCustomPlatformData> CachedFont::createCustomFontDataExperimentalParser(SharedBuffer& bytes, const String& itemInCollection, bool& wrapping)
Expand Down

0 comments on commit 81bff4c

Please sign in to comment.