Bug 1385462 - Ensure GlyphRunIterator::NextRun returns false immediately if the textrun's only glyphrun does not have a valid font. r=lsalzman, a=lizzard
authorJonathan Kew <jkew@mozilla.com>
Mon, 07 Aug 2017 17:26:08 +0100
changeset 421173 e08775132fa2aa7df8f0d2f35059651a47cc8e94
parent 421172 8a94cd4f9c0740240d1a33d0e310d0a1d36901ab
child 421174 ca6af5d8156575a85c8efdb9e11d6d3219e9c988
push id7615
push userryanvm@gmail.com
push dateMon, 14 Aug 2017 17:21:21 +0000
treeherdermozilla-beta@8638a6d915f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman, lizzard
bugs1385462
milestone56.0
Bug 1385462 - Ensure GlyphRunIterator::NextRun returns false immediately if the textrun's only glyphrun does not have a valid font. r=lsalzman, a=lizzard
gfx/thebes/gfxTextRun.cpp
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -60,17 +60,17 @@ gfxTextRun::GlyphRunIterator::NextRun()
     uint32_t glyphRunCount;
     if (mTextRun->mHasGlyphRunArray) {
         glyphRunCount = mTextRun->mGlyphRunArray.Length();
         if (mNextIndex >= glyphRunCount) {
             return false;
         }
         mGlyphRun = &mTextRun->mGlyphRunArray[mNextIndex];
     } else {
-        if (mNextIndex > 0) {
+        if (mNextIndex > 0 || !mTextRun->mSingleGlyphRun.mFont) {
             return false;
         }
         glyphRunCount = 1;
         mGlyphRun = &mTextRun->mSingleGlyphRun;
     }
 
     if (mGlyphRun->mCharacterOffset >= mEndOffset) {
         return false;