Skip to content

Commit e008d84

Browse files
committed
Fix integer overflow on 32bit targets
1 parent 8dba2b4 commit e008d84

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/compress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn compress<
119119
.iter()
120120
.filter_map(|entry| {
121121
// zstd dictionary data is limited to 4GB
122-
if sample.len() >= 4 * 1024 * 1024 * 1024 - 128 * 1024 {
122+
if sample.len() > u32::MAX as usize - 128 * 1024 {
123123
return None;
124124
}
125125
let entry = entry.as_ref().ok()?;

0 commit comments

Comments
 (0)