[transform-swf-updates] BUG: Transform SWF 3.0 Beta, TextSettings does not support long headers
Brought to you by:
smackay
From: News on r. b. a. p. f. T. S. f. J. <tra...@li...> - 2010-06-30 13:26:24
|
The constructor that decodes a TextSettings assumes that the header (type and length fields) is always in the short form, i.e. 16-bits long. This is not always the case, even though the length of an encoded object can never be more than 14 bytes. The code should be changed from: public TextSettings(final SWFDecoder coder) throws IOException { coder.readUnsignedShort(); identifier = coder.readUnsignedShort(); rendering = coder.readByte(); thickness = coder.readInt(); sharpness = coder.readInt(); coder.readByte(); } to public TextSettings(final SWFDecoder coder) throws IOException { int length = coder.readUnsignedShort() & Coder.LENGTH_FIELD; if (length == Coder.IS_EXTENDED) { length = coder.readInt(); } identifier = coder.readUnsignedShort(); rendering = coder.readByte(); thickness = coder.readInt(); sharpness = coder.readInt(); coder.readByte(); } A patch is attached for this change. The SVN repository has also been updated. A new release (for download and on the Maven Central Repository) will not be available until a few more bugs have accumulated. Regards, Stuart -- Flagstone Software Ltd. |