claus / as3swf

Low level Actionscript 3 library to parse, create, modify and publish SWF files.
MIT License
525 stars 127 forks source link

Missing SWFMorphFillStyle's? #18

Closed haysclark closed 12 years ago

haysclark commented 12 years ago

This error is happening in 'SwfTimelineContainer.as' when I try to load a swf. I'm guessing these are Morph targets blowing up the parser. I have shared an example FLA and SWF here which cause the problems. I can't actually find the frame that is causing the problem.

FLA: http://dl.dropbox.com/u/224564/problemAsset.fla SWF: http://dl.dropbox.com/u/224564/problemAsset.swf

Error: Unknown fill style type: 0x13
    at com.codeazur.as3swf.data::SWFMorphFillStyle/parse()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\data\SWFMorphFillStyle.as:48]
    at com.codeazur.as3swf.data::SWFMorphFillStyle()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\data\SWFMorphFillStyle.as:22]
    at com.codeazur.as3swf::SWFData/readMORPHFILLSTYLE()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\SWFData.as:593]
    at com.codeazur.as3swf.tags::TagDefineMorphShape2/parse()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\tags\TagDefineMorphShape2.as:36]
    at com.codeazur.as3swf::SWFTimelineContainer/parseTag()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\SWFTimelineContainer.as:185]
    at com.codeazur.as3swf::SWFTimelineContainer/parseTagsAsyncInternal()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\SWFTimelineContainer.as:137]
    at com.codeazur.as3swf::SWFTimelineContainer/parseTagsAsyncHandler()[C:\Users\hclark\popcap\sb-trinket-tool\src\com\codeazur\as3swf\SWFTimelineContainer.as:130]

I changed the code to not throw an error and I get the following style requests: Encountered unknown fill style type: 0x13 Encountered unknown fill style type: 0xb5 Encountered unknown fill style type: 0xff Encountered unknown fill style type: 0x31 Encountered unknown fill style type: 0xdb Encountered unknown fill style type: 0x34 Encountered unknown fill style type: 0x8b Encountered unknown fill style type: 0xd6 Encountered unknown fill style type: 0x34 Encountered unknown fill style type: 0x4e Encountered unknown fill style type: 0x4 Encountered unknown fill style type: 0xd4 Encountered unknown fill style type: 0xce Encountered unknown fill style type: 0x8c Encountered unknown fill style type: 0x3 Encountered unknown fill style type: 0xc6 Encountered unknown fill style type: 0xa1 Encountered unknown fill style type: 0x63 Encountered unknown fill style type: 0x3e Encountered unknown fill style type: 0x3e Encountered unknown fill style type: 0x9d Encountered unknown fill style type: 0x89 Encountered unknown fill style type: 0x1e Encountered unknown fill style type: 0x86 Encountered unknown fill style type: 0xe8 Encountered unknown fill style type: 0xf1 Encountered unknown fill style type: 0x2 Encountered unknown fill style type: 0x58 Encountered unknown fill style type: 0x79 Encountered unknown fill style type: 0xff Encountered unknown fill style type: 0xbd Encountered unknown fill style type: 0xb2 Encountered unknown fill style type: 0x4f Encountered unknown fill style type: 0x86 Encountered unknown fill style type: 0x86 Encountered unknown fill style type: 0x2b Encountered unknown fill style type: 0x26 Encountered unknown fill style type: 0x5b Encountered unknown fill style type: 0xff Encountered unknown fill style type: 0x1b Encountered unknown fill style type: 0x77 Encountered unknown fill style type: 0x3a Encountered unknown fill style type: 0x31 Encountered unknown fill style type: 0xf7 Encountered unknown fill style type: 0xfd Encountered unknown fill style type: 0x64 Encountered unknown fill style type: 0x70 Encountered unknown fill style type: 0x63 Encountered unknown fill style type: 0x7c Encountered unknown fill style type: 0x7f WARNING: parse error: Unknown fill style type: 0x35, Tag: DefineMorphShape2, Index: 15

claus commented 12 years ago

Nice find. It's looks like a morphed focal gradient (not documented in SWF10). I'm on it.

claus commented 12 years ago

Preliminary fix:

http://dl.dropbox.com/u/59138954/as3swf.swc

Not committed, because i have to properly test yet.

metaine commented 11 years ago

claus, I experience the same issue with pulled swc and source code. Can you reshare preliminary fix? its not accessible

metaine commented 11 years ago

Error: Unknown fill style type: 0x5

Thanks for your work, anyways!

claus commented 11 years ago

@metaine - that fix has landed since i posted that preliminary fix, see https://github.com/claus/as3swf/commit/7f36d9e9a38045e9268d2d8abdca206688a3017c Can you send me the SWF you have problems with? There is no fill style type 5, at least not to my knowledge, so either it's undocumented or something else goes wrong.

claus commented 11 years ago

@metaine - fixed with https://github.com/claus/as3swf/commit/32cfe4888222b1ec2727a58d60dae10678ebbf65. Thanks for reporting this.