Some Flash files contain "corrupted" DefineMorphShape tags where a block
of 33 zero bytes are included in the body of the tag. Transform tests
explicitly for this and treats the tag as being empty allowing the
remainder of the file to be decoded. The corrupted object is never used
so movies can be decoded and re-encoded successfully.
However after successive refactorings the block of zero bytes is still
detected but not skipped over. The result is that when the block of zero
bytes is read it appears to be an "end of movie" marker and so decoding
of the movie terminates prematurely but no error is reported.
Changing line 219-221 of DefineMorphShape.java from
if (length - coder.bytesRead() != 33) {
coder.check(length);
}
to
if (length - coder.bytesRead() == 33) {
coder.skip(33);
} else {
coder.check(length);
}
fixes this bug. A patch file is also included that performs this task.
The repository has been updated.
Regards,
Stuart
--
Flagstone Software Ltd.
|