swf: Fill styles are byte aligned

A bitmap fill style ends in a matrix, but the overall type should
still be byte aligned. This could cause certain shapes with bitmap
line styles to be incorrectly parsed. Fixes #1192.
This commit is contained in:
Mike Welsh 2020-10-10 02:02:04 -07:00
parent aedf1aa11d
commit ed99a15dee
2 changed files with 2 additions and 0 deletions

View File

@ -848,6 +848,7 @@ impl<R: Read> Reader<R> {
let num_bits = self.read_ubits(5)? as usize;
m.tx = self.read_sbits_twips(num_bits)?;
m.ty = self.read_sbits_twips(num_bits)?;
self.byte_align();
Ok(m)
}

View File

@ -497,6 +497,7 @@ impl<W: Write> Writer<W> {
self.write_ubits(5, num_bits.into())?;
self.write_sbits_twips(num_bits, m.tx)?;
self.write_sbits_twips(num_bits, m.ty)?;
self.flush_bits()?;
Ok(())
}