ende76 / brotli-rs

A Brotli implementation in pure and safe Rust
Apache License 2.0
64 stars 19 forks source link

Fixes #19 #20

Closed danielrh closed 8 years ago

danielrh commented 8 years ago

Before only a few fields were cleared when a Metablock Header was encountered

However the btype_l may refer to an array of different dimension than the one for this metablock. This resets everything to the ground state.

Also added a test to demonstrate the behavior (test used to fail but now passes)

ende76 commented 8 years ago

@danielrh You're amazing, Daniel! The fix looks correct, and, yes, it's entirely reasonable to start with a fresh metablock when a new metablock header starts. I didn't do a good job at all testing for cases with multiple metablocks, and that debt's now asking to get paid. Thanks a lot for finding, reporting, and fixing this, Daniel!