File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -218,16 +218,17 @@ pub fn is_zst(buf: &[u8]) -> bool {
218
218
}
219
219
220
220
let magic = u32:: from_le_bytes ( buf[ 0 ..4 ] . try_into ( ) . unwrap ( ) ) as usize ;
221
- if magic & ZSTD_SKIP_MASK = = ZSTD_SKIP_START {
222
- let data_len = u32 :: from_le_bytes ( buf [ 4 .. 8 ] . try_into ( ) . unwrap ( ) ) as usize ;
223
- if buf . len ( ) < 8 + data_len {
224
- return false ;
225
- }
226
- let next_frame = & buf [ 8 + data_len.. ] ;
227
- return is_zst ( next_frame ) ;
221
+ if magic & ZSTD_SKIP_MASK ! = ZSTD_SKIP_START {
222
+ return false ;
223
+ }
224
+
225
+ let data_len = u32 :: from_le_bytes ( buf [ 4 .. 8 ] . try_into ( ) . unwrap ( ) ) as usize ;
226
+ if buf . len ( ) < 8 + data_len {
227
+ return false ;
228
228
}
229
229
230
- false
230
+ let next_frame = & buf[ 8 + data_len..] ;
231
+ is_zst ( next_frame)
231
232
}
232
233
233
234
/// Returns whether a buffer is a MSI Windows Installer archive.
You can’t perform that action at this time.
0 commit comments