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:
parent
aedf1aa11d
commit
ed99a15dee
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue