File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -994,13 +994,30 @@ impl<'data> CompressedData<'data> {
994
994
. read_error ( "Invalid zlib compressed data" ) ?;
995
995
}
996
996
CompressionFormat :: Zstandard => {
997
- let mut decoder = ruzstd:: StreamingDecoder :: new ( self . data )
998
- . ok ( )
999
- . read_error ( "Invalid zstd compressed data" ) ?;
1000
- decoder
1001
- . read_to_end ( & mut decompressed)
1002
- . ok ( )
1003
- . read_error ( "Invalid zstd compressed data" ) ?;
997
+ let mut input = self . data ;
998
+ while !input. is_empty ( ) {
999
+ let mut decoder = match ruzstd:: StreamingDecoder :: new ( & mut input) {
1000
+ Ok ( decoder) => decoder,
1001
+ Err (
1002
+ ruzstd:: frame_decoder:: FrameDecoderError :: ReadFrameHeaderError (
1003
+ ruzstd:: frame:: ReadFrameHeaderError :: SkipFrame {
1004
+ length,
1005
+ ..
1006
+ } ,
1007
+ ) ,
1008
+ ) => {
1009
+ input = & input
1010
+ . get ( length as usize ..)
1011
+ . read_error ( "Invalid zstd compressed data" ) ?;
1012
+ continue ;
1013
+ }
1014
+ x => x. ok ( ) . read_error ( "Invalid zstd compressed data" ) ?,
1015
+ } ;
1016
+ decoder
1017
+ . read_to_end ( & mut decompressed)
1018
+ . ok ( )
1019
+ . read_error ( "Invalid zstd compressed data" ) ?;
1020
+ }
1004
1021
}
1005
1022
_ => unreachable ! ( ) ,
1006
1023
}
You can’t perform that action at this time.
0 commit comments