diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 738f7cf2d..1b28683ba 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -129,7 +129,6 @@ import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.decompiler.graph.model.LocalData; -import com.jpexs.helpers.ByteArrayRange; import com.jpexs.helpers.Cache; import com.jpexs.helpers.Helper; import com.jpexs.helpers.NulStream; @@ -1434,20 +1433,6 @@ public final class SWF implements SWFContainerItem, Timelined { } } - public static boolean hasErrorHeader(byte[] data) { - return hasErrorHeader(new ByteArrayRange(data)); - } - - public static boolean hasErrorHeader(ByteArrayRange data) { - if (data.getLength() > 4) { - if ((data.get(0) & 0xff) == 0xff && (data.get(1) & 0xff) == 0xd9 - && (data.get(2) & 0xff) == 0xff && (data.get(3) & 0xff) == 0xd8) { - return true; - } - } - return false; - } - public static void populateVideoFrames(int streamId, List tags, HashMap output) { for (Tag t : tags) { if (t instanceof VideoFrameTag) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ABCContainerTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ABCContainerTag.java index 9d11fc6d6..fec4ce873 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ABCContainerTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ABCContainerTag.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java index be79e5ced..d17240a28 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java @@ -29,7 +29,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index ee079bad2..595b41e87 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -27,7 +27,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java index 69b2d78f1..c72810842 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java @@ -34,6 +34,10 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; +/** + * + * @author JPEXS + */ public class DefineBinaryDataTag extends CharacterTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index d8fd686c7..3bc1cbe50 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -32,7 +32,13 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { @SWFType(BasicType.UI16) @@ -55,10 +61,8 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { @Override public InputStream getImageData() { - if (SWF.hasErrorHeader(imageData)) { - return new ByteArrayInputStream(imageData.getArray(), imageData.getPos() + 4, imageData.getLength() - 4); - } - return new ByteArrayInputStream(imageData.getArray(), imageData.getPos(), imageData.getLength()); + int errorLength = hasErrorHeader(imageData) ? 4 : 0; + return new ByteArrayInputStream(imageData.getArray(), imageData.getPos() + errorLength, imageData.getLength() - errorLength); } @Override @@ -72,6 +76,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { cachedImage = ret; return ret; } catch (IOException ex) { + Logger.getLogger(DefineBitsJPEG2Tag.class.getName()).log(Level.SEVERE, "Failed to get image", ex); } return null; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index f00498afd..960911ac1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -33,7 +33,13 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { @SWFType(BasicType.UI16) @@ -80,7 +86,8 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { @Override public InputStream getImageData() { - return null; + int errorLength = hasErrorHeader(imageData) ? 4 : 0; + return new ByteArrayInputStream(imageData.getArray(), imageData.getPos() + errorLength, imageData.getLength() - errorLength); } @Override @@ -89,14 +96,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { return cachedImage; } try { - InputStream stream; - if (SWF.hasErrorHeader(imageData)) { - stream = new ByteArrayInputStream(imageData.getArray(), imageData.getPos() + 4, imageData.getLength() - 4); - } else { - stream = new ByteArrayInputStream(imageData.getArray(), imageData.getPos(), imageData.getLength()); - } - - BufferedImage image = ImageHelper.read(stream); + BufferedImage image = ImageHelper.read(getImageData()); SerializableImage img = image == null ? null : new SerializableImage(image); if (bitmapAlphaData.length == 0) { cachedImage = img; @@ -112,6 +112,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { cachedImage = img; return img; } catch (IOException ex) { + Logger.getLogger(DefineBitsJPEG3Tag.class.getName()).log(Level.SEVERE, "Failed to get image", ex); } return null; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index 89625be41..7beb81d69 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -33,9 +33,10 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; /** - * * * @author JPEXS */ @@ -88,7 +89,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { @Override public InputStream getImageData() { - return null; + return new ByteArrayInputStream(imageData.getArray(), imageData.getPos(), imageData.getLength()); } @Override @@ -97,7 +98,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { return cachedImage; } try { - BufferedImage image = ImageHelper.read(new ByteArrayInputStream(imageData.getArray(), imageData.getPos(), imageData.getLength())); + BufferedImage image = ImageHelper.read(getImageData()); SerializableImage img = image == null ? null : new SerializableImage(image); if (bitmapAlphaData.getLength() == 0) { cachedImage = img; @@ -113,6 +114,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { cachedImage = img; return img; } catch (IOException ex) { + Logger.getLogger(DefineBitsJPEG4Tag.class.getName()).log(Level.SEVERE, "Failed to get image", ex); } return null; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index f6f8416f5..db47ef54b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -42,6 +42,10 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.InflaterInputStream; +/** + * + * @author JPEXS + */ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { @SWFType(BasicType.UI16) @@ -267,6 +271,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { pos32aligned++; } } + cachedImage = bi; return bi; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index 1dd4fe1fd..1d19d1c22 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -42,6 +42,10 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.InflaterInputStream; +/** + * + * @author JPEXS + */ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java index 231aa06b7..c9e26d9b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java @@ -30,7 +30,13 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineBitsTag extends ImageTag implements TagChangedListener { @SWFType(BasicType.UI16) @@ -88,17 +94,17 @@ public class DefineBitsTag extends ImageTag implements TagChangedListener { try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { byte[] jttdata = swf.getJtt().jpegData; if (jttdata.length != 0) { - boolean jttError = SWF.hasErrorHeader(jttdata); - baos.write(jttdata, jttError ? 4 : 0, jttdata.length - (jttError ? 6 : 2)); - baos.write(jpegData.getArray(), jpegData.getPos() + (SWF.hasErrorHeader(jpegData) ? 6 : 2), jpegData.getLength() - (jttError ? 6 : 2)); - } else { - baos.write(jpegData.getArray(), jpegData.getPos(), jpegData.getLength()); + int jttErrorLength = hasErrorHeader(jttdata) ? 4 : 0; + baos.write(jttdata, jttErrorLength, jttdata.length - jttErrorLength - 2); } + + int jpegDataErrorLength = hasErrorHeader(jpegData) ? 4 : 0; + baos.write(jpegData.getArray(), jpegData.getPos() + jpegDataErrorLength + 2, jpegData.getLength() - jpegDataErrorLength - 2); SerializableImage ret = new SerializableImage(ImageHelper.read(new ByteArrayInputStream(baos.toByteArray()))); cachedImage = ret; return ret; } catch (IOException ex) { - return null; + Logger.getLogger(DefineBitsTag.class.getName()).log(Level.SEVERE, "Failed to get image", ex); } } return null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index 40afa9771..b11767b78 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -29,7 +29,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index 9573d6d9d..3c78a61f9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -29,7 +29,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index da3073441..08b420e40 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -78,7 +78,6 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index dd1e3c3d7..73a606c43 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -38,7 +38,6 @@ import java.util.ArrayList; import java.util.List; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index 03b2d5229..18122da97 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -41,6 +41,10 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +/** + * + * @author JPEXS + */ public class DefineFont3Tag extends FontTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index 5ab3035b4..10611ae7a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -28,6 +28,10 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +/** + * + * @author JPEXS + */ public class DefineFont4Tag extends CharacterTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java index 04077ec40..cbcd0039b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java @@ -32,6 +32,10 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +/** + * + * @author JPEXS + */ public class DefineFontAlignZonesTag extends Tag implements CharacterIdTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index dfe16fc43..f4c5be3ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -33,7 +33,6 @@ import java.util.ArrayList; import java.util.List; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index fa65a479a..268aa2afa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -32,7 +32,6 @@ import java.util.ArrayList; import java.util.List; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java index 02425e0ce..e003004ea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java @@ -27,6 +27,10 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +/** + * + * @author JPEXS + */ public class DefineFontNameTag extends Tag implements CharacterIdTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java index dc46122d6..15b44206f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.List; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index 62f39f9cb..2f8a1886c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index c9b386f13..2d7f100f8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -32,7 +32,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index 2bcbeb1a4..3539736a9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.OutputStream; /** + * * @author JPEXS */ public class DefineScalingGridTag extends Tag implements CharacterIdTag { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java index 6415e4c10..36332d763 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.io.OutputStream; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java index c91647441..427179eaf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java @@ -33,6 +33,10 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineShape2Tag extends ShapeTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java index 4de67f217..bf5c7327f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java @@ -33,6 +33,10 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineShape3Tag extends ShapeTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java index 24c5c26a6..b0ebcbf94 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java @@ -34,6 +34,10 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineShape4Tag extends ShapeTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index a9a1fe9e3..490c5c4a8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -32,6 +32,10 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DefineShapeTag extends ShapeTag { @SWFType(BasicType.UI16) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index aebdbc72a..13713bd64 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -42,7 +42,6 @@ import javax.sound.sampled.AudioSystem; import javax.sound.sampled.UnsupportedAudioFileException; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 11b3fd2ce..ce40e4264 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -53,6 +53,8 @@ import java.util.Set; /** * Defines a sprite character + * + * @author JPEXS */ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timelined { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index 5225bec26..8e6d612cd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.util.ArrayList; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index be2764e7f..c100393a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.List; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java index 61dfab3f5..3417f673e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java @@ -32,7 +32,6 @@ import java.io.OutputStream; import java.util.Set; /** - * * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index aeae933d4..eff6b7bc6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -36,6 +36,8 @@ import java.io.OutputStream; /** * Defines a series of ActionScript 3 bytecodes to be executed + * + * @author JPEXS */ public class DoABCDefineTag extends Tag implements ABCContainerTag { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index a9ec9fae7..bab1cbf81 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -34,6 +34,8 @@ import java.io.OutputStream; /** * Defines a series of ActionScript 3 bytecodes to be executed + * + * @author JPEXS */ public class DoABCTag extends Tag implements ABCContainerTag { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index ac17f4528..4645aadc8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -37,6 +37,8 @@ import java.util.logging.Logger; /** * Instructs Flash Player to perform a list of actions when the current frame is * complete. + * + * @author JPEXS */ public class DoActionTag extends Tag implements ASMSource { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 01b6b9210..b3658b5c0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -39,6 +39,10 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +/** + * + * @author JPEXS + */ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource { /** diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java index 052acf1ab..07227b827 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java @@ -71,7 +71,7 @@ public abstract class ImageTag extends CharacterTag implements DrawableTag { } public static String getImageFormat(ByteArrayRange data) { - if (SWF.hasErrorHeader(data)) { + if (hasErrorHeader(data)) { return "jpg"; } if (data.getLength() > 2 && ((data.get(0) & 0xff) == 0xff) && ((data.get(1) & 0xff) == 0xd8)) { @@ -88,6 +88,20 @@ public abstract class ImageTag extends CharacterTag implements DrawableTag { return "unk"; } + public static boolean hasErrorHeader(byte[] data) { + return hasErrorHeader(new ByteArrayRange(data)); + } + + public static boolean hasErrorHeader(ByteArrayRange data) { + if (data.getLength() > 4) { + if ((data.get(0) & 0xff) == 0xff && (data.get(1) & 0xff) == 0xd9 + && (data.get(2) & 0xff) == 0xff && (data.get(3) & 0xff) == 0xd8) { + return true; + } + } + return false; + } + protected static int max255(float val) { if (val > 255) { return 255;