///!
///! [`DecompressError::ShortData`]: ../enum.DecompressError.html#variant.ShortData
///! [`DecompressError::OutputFull`]: ../enum.DecompressError.html#variant.OutputFull
+ #[allow(clippy::comparison_chain)]
pub fn decompress_data(&mut self, src: &[u8], dst: &mut [u8], continue_block: bool) -> DecompressResult<usize> {
if src.is_empty() || dst.is_empty() {
return Err(DecompressError::InvalidArgument);
///! Decompresses input data into output returning the uncompressed data length.
pub fn uncompress(src: &[u8], dst: &mut [u8]) -> DecompressResult<usize> {
let mut inflate = Self::new();
- let off = if src.len() > 2 && src[0] == 0x78 && src[1] == 0x9C { 2 } else { 0 };
+ let off = if src.len() > 2 && src[0] == 0x78 && (src[1] != 0 && ((src[1] - 1) % 31) == 0) { 2 } else { 0 };
inflate.decompress_data(&src[off..], dst, false)
}
}