diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index cf0eb6619..12459889c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -51,7 +51,6 @@ import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemContainer; -import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java index e857b22d8..c6d938757 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -456,6 +456,15 @@ public class SWFOutputStream extends OutputStream { } return nBits; } + + public static int getNeededBitsU(int first, int... params) { + int nBits = 0; + nBits = enlargeBitCountU(nBits, first); + for (int i = 0; i < params.length; i++) { + nBits = enlargeBitCountU(nBits, params[i]); + } + return nBits; + } private static long getIntPart(double value) { if (value < 0) { @@ -491,13 +500,21 @@ public class SWFOutputStream extends OutputStream { return getNeededBitsS(k) + 16; } - private static int enlargeBitCountS(int currentBitCount, int value) { + public static int enlargeBitCountS(int currentBitCount, int value) { int neededNew = getNeededBitsS(value); if (neededNew > currentBitCount) { return neededNew; } return currentBitCount; } + + public static int enlargeBitCountU(int currentBitCount, int value) { + int neededNew = getNeededBitsU(value); + if (neededNew > currentBitCount) { + return neededNew; + } + return currentBitCount; + } /** * Writes MATRIX value to the stream diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java index 25a100319..e3e7f62d0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.DecLocalAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.graph.GraphTargetItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java index 8e529e09b..c4ab8bf55 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.DecLocalAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.graph.GraphTargetItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java index 3ba1ceedd..6918094b8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.HashMap; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java index 9eab0cabd..89d778556 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IncLocalAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.graph.GraphTargetItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java index 393dc580e..c6ad55b2a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IncLocalAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.graph.GraphTargetItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index f1a3d84ba..73ceb8ddd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -28,7 +28,6 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IncrementAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NewActivationAVM2Item; -import com.jpexs.decompiler.flash.abc.avm2.model.NotCompileTimeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 362eb66e9..cef533c2b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.action.model.CallFunctionActionItem; import com.jpexs.decompiler.flash.action.model.ConstantPool; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.ExtendsActionItem; @@ -29,7 +28,6 @@ import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem; import com.jpexs.decompiler.flash.action.model.GetVariableActionItem; import com.jpexs.decompiler.flash.action.model.ImplementsOpActionItem; -import com.jpexs.decompiler.flash.action.model.NewMethodActionItem; import com.jpexs.decompiler.flash.action.model.NewObjectActionItem; import com.jpexs.decompiler.flash.action.model.SetMemberActionItem; import com.jpexs.decompiler.flash.action.model.SetPropertyActionItem; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 0283a694e..b5dced3ad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -3026,7 +3026,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel rec.add(tr); mat.translateX = x * width / sloupcu; mat.translateY = y * height / radku; - sos2.writeTag(new DefineTextTag(null, 999 + f, new RECT(0, width, 0, height), new MATRIX(), SWFOutputStream.getNeededBitsU(countGlyphs - 1), SWFOutputStream.getNeededBitsU(0), rec)); + sos2.writeTag(new DefineTextTag(null, 999 + f, new RECT(0, width, 0, height), new MATRIX(), rec)); sos2.writeTag(new PlaceObject2Tag(null, false, false, false, true, false, true, true, false, 1 + f, 999 + f, mat, null, 0, null, 0, null)); x++; } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java index 7c29b5741..d707fe888 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/SlotConstTraitDetailPanel.java @@ -25,12 +25,8 @@ import static com.jpexs.decompiler.flash.gui.AppStrings.translate; import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.helpers.Helper; import java.awt.BorderLayout; -import java.awt.Font; import java.util.ArrayList; import javax.swing.*; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyledDocument; import jsyntaxpane.syntaxkits.Flasm3MethodInfoSyntaxKit; /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index b41306ec7..c9092aebf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -62,8 +62,6 @@ public class DefineText2Tag extends TextTag implements DrawableTag { public int characterID; public RECT textBounds; public MATRIX textMatrix; - public int glyphBits; - public int advanceBits; public List textRecords; public static final int ID = 33; @@ -159,10 +157,11 @@ public class DefineText2Tag extends TextTag implements DrawableTag { @Override public boolean setFormattedText(MissingCharacterHandler missingCharHandler, List tags, String text, String fontName) throws ParseException { + List oldTextRecords = textRecords; try { TextLexer lexer = new TextLexer(new InputStreamReader(new ByteArrayInputStream(text.getBytes("UTF-8")), "UTF-8")); ParsedSymbol s = null; - List textRecords = new ArrayList<>(); + textRecords = new ArrayList<>(); RGBA colorA = null; int fontId = -1; int textHeight = -1; @@ -171,8 +170,6 @@ public class DefineText2Tag extends TextTag implements DrawableTag { Integer y = null; int currentX = 0; int currentY = 0; - int glyphBits = 0; - int advanceBits = 0; int maxX = Integer.MIN_VALUE; int minX = Integer.MAX_VALUE; MATRIX textMatrix = new MATRIX(); @@ -303,6 +300,7 @@ public class DefineText2Tag extends TextTag implements DrawableTag { throw new ParseException("Font not defined", lexer.yyline()); } TEXTRECORD tr = new TEXTRECORD(); + textRecords.add(tr); if (fontId > -1) { tr.fontId = fontId; tr.textHeight = textHeight; @@ -328,12 +326,13 @@ public class DefineText2Tag extends TextTag implements DrawableTag { tr.glyphEntries = new GLYPHENTRY[txt.length()]; for (int i = 0; i < txt.length(); i++) { char c = txt.charAt(i); - tr.glyphEntries[i] = new GLYPHENTRY(); + if (!font.containsChar(tags, c)) { if (!missingCharHandler.handle(font, tags, c)) { return false; } } + tr.glyphEntries[i] = new GLYPHENTRY(); tr.glyphEntries[i].glyphIndex = font.charToGlyph(tags, c); int advance; @@ -345,15 +344,8 @@ public class DefineText2Tag extends TextTag implements DrawableTag { tr.glyphEntries[i].glyphAdvance = advance; currentX += advance; - if (SWFOutputStream.getNeededBitsU(tr.glyphEntries[i].glyphIndex) > glyphBits) { - glyphBits = SWFOutputStream.getNeededBitsU(tr.glyphEntries[i].glyphIndex); - } - if (SWFOutputStream.getNeededBitsS(tr.glyphEntries[i].glyphAdvance) > advanceBits) { - advanceBits = SWFOutputStream.getNeededBitsS(tr.glyphEntries[i].glyphAdvance); - } } - textRecords.add(tr); if (currentX > maxX) { maxX = currentX; } @@ -364,8 +356,6 @@ public class DefineText2Tag extends TextTag implements DrawableTag { } } - this.advanceBits = advanceBits; - this.glyphBits = glyphBits; this.textRecords = textRecords; this.textBounds = textBounds; //this.textBounds.Xmin = minX; @@ -373,7 +363,11 @@ public class DefineText2Tag extends TextTag implements DrawableTag { } catch (UnsupportedEncodingException ex) { Logger.getLogger(DefineText2Tag.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { + textRecords = oldTextRecords; return false; + } catch (ParseException ex) { + textRecords = oldTextRecords; + throw ex; } return true; } @@ -403,6 +397,15 @@ public class DefineText2Tag extends TextTag implements DrawableTag { sos.writeUI16(characterID); sos.writeRECT(textBounds); sos.writeMatrix(textMatrix); + + int glyphBits = 0; + int advanceBits = 0; + for (TEXTRECORD tr : textRecords) { + for (GLYPHENTRY ge : tr.glyphEntries) { + glyphBits = SWFOutputStream.enlargeBitCountU(glyphBits, ge.glyphIndex); + advanceBits = SWFOutputStream.enlargeBitCountS(advanceBits, ge.glyphAdvance); + } + } sos.writeUI8(glyphBits); sos.writeUI8(advanceBits); for (TEXTRECORD tr : textRecords) { @@ -429,8 +432,8 @@ public class DefineText2Tag extends TextTag implements DrawableTag { characterID = sis.readUI16(); textBounds = sis.readRECT(); textMatrix = sis.readMatrix(); - glyphBits = sis.readUI8(); - advanceBits = sis.readUI8(); + int glyphBits = sis.readUI8(); + int advanceBits = sis.readUI8(); textRecords = new ArrayList<>(); TEXTRECORD tr; while ((tr = sis.readTEXTRECORD(true, glyphBits, advanceBits)) != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index 46253cd0a..559e36aff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -62,8 +62,6 @@ public class DefineTextTag extends TextTag implements DrawableTag { public int characterID; public RECT textBounds; public MATRIX textMatrix; - public int glyphBits; - public int advanceBits; public List textRecords; public static final int ID = 11; @@ -159,10 +157,11 @@ public class DefineTextTag extends TextTag implements DrawableTag { @Override public boolean setFormattedText(MissingCharacterHandler missingCharHandler, List tags, String text, String fontName) throws ParseException { + List oldTextRecords = textRecords; try { TextLexer lexer = new TextLexer(new InputStreamReader(new ByteArrayInputStream(text.getBytes("UTF-8")), "UTF-8")); ParsedSymbol s = null; - List textRecords = new ArrayList<>(); + textRecords = new ArrayList<>(); RGB color = null; int fontId = -1; int textHeight = -1; @@ -171,8 +170,6 @@ public class DefineTextTag extends TextTag implements DrawableTag { Integer y = null; int currentX = 0; int currentY = 0; - int glyphBits = 0; - int advanceBits = 0; int maxX = Integer.MIN_VALUE; int minX = Integer.MAX_VALUE; MATRIX textMatrix = new MATRIX(); @@ -302,6 +299,7 @@ public class DefineTextTag extends TextTag implements DrawableTag { throw new ParseException("Font not defined", lexer.yyline()); } TEXTRECORD tr = new TEXTRECORD(); + textRecords.add(tr); if (fontId > -1) { tr.fontId = fontId; tr.textHeight = textHeight; @@ -327,12 +325,13 @@ public class DefineTextTag extends TextTag implements DrawableTag { tr.glyphEntries = new GLYPHENTRY[txt.length()]; for (int i = 0; i < txt.length(); i++) { char c = txt.charAt(i); - tr.glyphEntries[i] = new GLYPHENTRY(); + if (!font.containsChar(tags, c)) { if (!missingCharHandler.handle(font, tags, c)) { return false; } } + tr.glyphEntries[i] = new GLYPHENTRY(); tr.glyphEntries[i].glyphIndex = font.charToGlyph(tags, c); int advance; @@ -344,15 +343,9 @@ public class DefineTextTag extends TextTag implements DrawableTag { tr.glyphEntries[i].glyphAdvance = advance; currentX += advance; - if (SWFOutputStream.getNeededBitsU(tr.glyphEntries[i].glyphIndex) > glyphBits) { - glyphBits = SWFOutputStream.getNeededBitsU(tr.glyphEntries[i].glyphIndex); - } - if (SWFOutputStream.getNeededBitsS(tr.glyphEntries[i].glyphAdvance) > advanceBits) { - advanceBits = SWFOutputStream.getNeededBitsS(tr.glyphEntries[i].glyphAdvance); - } } - textRecords.add(tr); + if (currentX > maxX) { maxX = currentX; } @@ -363,9 +356,6 @@ public class DefineTextTag extends TextTag implements DrawableTag { } } - this.advanceBits = advanceBits; - this.glyphBits = glyphBits; - this.textRecords = textRecords; this.textMatrix = textMatrix; this.textBounds = textBounds; //this.textBounds.Xmin = minX; @@ -373,7 +363,11 @@ public class DefineTextTag extends TextTag implements DrawableTag { } catch (UnsupportedEncodingException ex) { Logger.getLogger(DefineTextTag.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { + textRecords = oldTextRecords; return false; + } catch (ParseException ex) { + textRecords = oldTextRecords; + throw ex; } return true; } @@ -383,13 +377,11 @@ public class DefineTextTag extends TextTag implements DrawableTag { return characterID; } - public DefineTextTag(SWF swf, int characterID, RECT textBounds, MATRIX textMatrix, int glyphBits, int advanceBits, List textRecords) { + public DefineTextTag(SWF swf, int characterID, RECT textBounds, MATRIX textMatrix, List textRecords) { super(swf, ID, "DefineText", new byte[0], 0); this.characterID = characterID; this.textBounds = textBounds; this.textMatrix = textMatrix; - this.glyphBits = glyphBits; - this.advanceBits = advanceBits; this.textRecords = textRecords; } @@ -408,6 +400,16 @@ public class DefineTextTag extends TextTag implements DrawableTag { sos.writeUI16(characterID); sos.writeRECT(textBounds); sos.writeMatrix(textMatrix); + + int glyphBits = 0; + int advanceBits = 0; + for (TEXTRECORD tr : textRecords) { + for (GLYPHENTRY ge : tr.glyphEntries) { + glyphBits = SWFOutputStream.enlargeBitCountU(glyphBits, ge.glyphIndex); + advanceBits = SWFOutputStream.enlargeBitCountS(advanceBits, ge.glyphAdvance); + } + } + sos.writeUI8(glyphBits); sos.writeUI8(advanceBits); for (TEXTRECORD tr : textRecords) { @@ -434,8 +436,8 @@ public class DefineTextTag extends TextTag implements DrawableTag { characterID = sis.readUI16(); textBounds = sis.readRECT(); textMatrix = sis.readMatrix(); - glyphBits = sis.readUI8(); - advanceBits = sis.readUI8(); + int glyphBits = sis.readUI8(); + int advanceBits = sis.readUI8(); textRecords = new ArrayList<>(); TEXTRECORD tr; while ((tr = sis.readTEXTRECORD(false, glyphBits, advanceBits)) != null) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index 37a5b4f7a..a1777ecab 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.action.Action; -import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.tags.base.ASMSource; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 2c1163914..8e5292e71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -128,6 +128,9 @@ public abstract class FontTag extends CharacterTag implements AloneTag { continue; } for (GLYPHENTRY en : tr.glyphEntries) { + if (en == null) { //Currently edited + continue; + } if (en.glyphIndex >= startIndex) { en.glyphIndex++; }