Bug 1850368 - (speculative patch) Add a null-check in gfxHarfBuzzShaper. r=gfx-reviewers,jnicol

Differential Revision: https://phabricator.services.mozilla.com/D187106
This commit is contained in:
Jonathan Kew 2023-08-30 13:56:48 +00:00
parent e5618939f0
commit c2c6bce3a5

View File

@ -1646,6 +1646,10 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText* aShapedText,
const hb_glyph_position_t* posInfo =
hb_buffer_get_glyph_positions(mBuffer, nullptr);
if (!posInfo) {
// Some kind of unexpected failure inside harfbuzz?
return NS_ERROR_UNEXPECTED;
}
while (glyphStart < int32_t(numGlyphs)) {
int32_t charEnd = ginfo[glyphStart].cluster;