Fix for GrAtlasTextContext crash
authorjoshualitt <joshualitt@chromium.org>
Wed, 29 Jul 2015 18:10:38 +0000 (11:10 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 29 Jul 2015 18:10:38 +0000 (11:10 -0700)
BUG=510931

Review URL: https://codereview.chromium.org/1256763005

src/gpu/GrAtlasTextBlob.h

index 1f37c67..502177d 100644 (file)
@@ -99,8 +99,9 @@ struct GrAtlasTextBlob : public SkRefCnt {
 
         SubRunInfo& push_back() {
             // Forward glyph / vertex information to seed the new sub run
-            SubRunInfo& prevSubRun = fSubRunInfo.back();
             SubRunInfo& newSubRun = fSubRunInfo.push_back();
+            SubRunInfo& prevSubRun = fSubRunInfo.fromBack(1);
+
             newSubRun.fGlyphStartIndex = prevSubRun.fGlyphEndIndex;
             newSubRun.fGlyphEndIndex = prevSubRun.fGlyphEndIndex;