Bug 1345461 - Adjust vector allocation. r=jrmuizel, a=abillings
authorJonathan Kew <jkew@mozilla.com>
Thu, 09 Mar 2017 21:07:05 +0000
changeset 379069 7f5193633d2e8420c49d0d22c703d1c5f30018c7
parent 379068 7c80fd53c63940df375009ae109807cd88b0c021
child 379070 0a52261a97afa0844ddeff7662e64844d630e41a
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, abillings
bugs1345461
milestone53.0
Bug 1345461 - Adjust vector allocation. r=jrmuizel, a=abillings
gfx/graphite2/README.mozilla
gfx/graphite2/src/FeatureMap.cpp
--- a/gfx/graphite2/README.mozilla
+++ b/gfx/graphite2/README.mozilla
@@ -1,6 +1,9 @@
 This directory contains the Graphite2 library release 1.3.8 from
 https://github.com/silnrsi/graphite/releases/download/1.3.8/graphite2-minimal-1.3.8.tgz
 See gfx/graphite2/moz-gr-update.sh for update procedure.
 
 Cherry-picked post-1.3.8 commit 56157cf9845d13452068c297205f96b946126cc2 to fix
 https://bugzilla.mozilla.org/show_bug.cgi?id=1261135.
+
+Cherry-picked post-1.3.9 commit 1ce331d5548b98ed8b818532b2556d6f2c7a3b83 to fix
+https://bugzilla.mozilla.org/show_bug.cgi?id=1345461.
--- a/gfx/graphite2/src/FeatureMap.cpp
+++ b/gfx/graphite2/src/FeatureMap.cpp
@@ -270,17 +270,17 @@ bool FeatureRef::applyValToFeature(uint3
 { 
     if (val>maxVal() || !m_pFace)
       return false;
     if (pDest.m_pMap==NULL)
       pDest.m_pMap = &m_pFace->theSill().theFeatureMap();
     else
       if (pDest.m_pMap!=&m_pFace->theSill().theFeatureMap())
         return false;       //incompatible
-    pDest.reserve(m_index);
+    pDest.reserve(m_index + 1);
     pDest[m_index] &= ~m_mask;
     pDest[m_index] |= (uint32(val) << m_bits);
     return true;
 }
 
 uint32 FeatureRef::getFeatureVal(const Features& feats) const
 { 
   if (m_index < feats.size() && &m_pFace->theSill().theFeatureMap()==feats.m_pMap)