Skip to content

Commit fa74963

Browse files
committed
Only derive the compression type once per folder
1 parent 7331f8f commit fa74963

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BinaryObjectScanner/FileType/MicrosoftCAB.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ private static void ExtractFile(string outDir, Stream blockStream, CFFILE file,
250250
if (dataBlocks == null || dataBlocks.Length == 0)
251251
return null;
252252

253+
// Get the compression type
254+
var compressionType = GetCompressionType(folder!);
255+
253256
// Setup decompressors
254257
var mszip = SabreTools.Compression.MSZIP.Decompressor.Create();
255258
//uint quantumWindowBits = (uint)(((ushort)folder.CompressionType >> 8) & 0x1f);
@@ -262,8 +265,6 @@ private static void ExtractFile(string outDir, Stream blockStream, CFFILE file,
262265
if (db?.CompressedData == null)
263266
continue;
264267

265-
// Get the compression type
266-
var compressionType = GetCompressionType(folder!);
267268
switch (compressionType)
268269
{
269270
// Uncompressed data

0 commit comments

Comments
 (0)