Skip to content

Commit

Permalink
swf: Avoid undefined behavior in write_fbits
Browse files Browse the repository at this point in the history
  • Loading branch information
Herschel committed May 13, 2020
1 parent 031f5d6 commit 081f6a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swf/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl<W: Write> Writer<W> {
}

fn write_fbits(&mut self, num_bits: u8, n: f32) -> Result<()> {
self.write_ubits(num_bits, (n * 65536f32) as u32)
self.write_sbits(num_bits, (n * 65536f32) as i32)
}

fn write_encoded_u32(&mut self, mut n: u32) -> Result<()> {
Expand Down

0 comments on commit 081f6a5

Please sign in to comment.