< prev index next >

src/java.desktop/share/native/libfontmanager/layout/LigatureSubstProc2.cpp

Print this page
rev 15133 : 8161923: Fix two memory issues.
Reviewed-by: vadim

@@ -147,15 +147,16 @@
                   if (LE_FAILURE(success)) {
                       currGlyph+= dir;
                       return nextStateIndex;
                   }
                     glyphStorage[componentGlyph] = LE_SET_GLYPH(glyphStorage[componentGlyph], ligatureGlyph);
-                    if(mm==nComponents) {
+                    ++mm;
+                    if (mm == nComponents) {
                       LE_DEBUG_BAD_FONT("exceeded nComponents");
                       mm--; // don't overrun the stack.
                     }
-                    stack[++mm] = componentGlyph;
+                    stack[mm] = componentGlyph;
                     i = 0;
                 } else {
                     glyphStorage[componentGlyph] = LE_SET_GLYPH(glyphStorage[componentGlyph], 0xFFFF);
                 }
             }
< prev index next >