Skip to content

Commit 861ac86

Browse files
bjorn3folkertdev
authored andcommitted
Use ZSTD_XXH64_update_slice in ZSTDv07_decompressContinue
1 parent 3955cca commit 861ac86

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/legacy/zstd_v07.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use libc::{calloc, free, malloc};
77
use crate::lib::common::error_private::Error;
88
use crate::lib::common::mem::{MEM_32bits, MEM_64bits, MEM_readLE16, MEM_readLE32, MEM_readLEST};
99
use crate::lib::common::xxhash::{
10-
XXH64_state_t, ZSTD_XXH64_digest, ZSTD_XXH64_reset, ZSTD_XXH64_update,
10+
XXH64_state_t, ZSTD_XXH64_digest, ZSTD_XXH64_reset, ZSTD_XXH64_update, ZSTD_XXH64_update_slice,
1111
};
1212
use crate::lib::decompress::huf_decompress::{DTableDesc, Writer};
1313

@@ -2675,7 +2675,10 @@ unsafe fn ZSTDv07_decompressContinue(
26752675
let rSize = rSize?;
26762676
dctx.previousDstEnd = dst.as_ptr().add(rSize);
26772677
if dctx.fParams.checksumFlag != 0 {
2678-
ZSTD_XXH64_update(&mut dctx.xxhState, dst.as_ptr().cast(), rSize as usize);
2678+
ZSTD_XXH64_update_slice(
2679+
&mut dctx.xxhState,
2680+
dst.subslice(..rSize as usize).as_slice(),
2681+
);
26792682
}
26802683
return Ok(rSize);
26812684
}

0 commit comments

Comments
 (0)