From 1230330ce1dad6236e662c563badc9cca7bf5980 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 5 Jul 2018 03:13:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20compressed=20size=20(it=20?= =?UTF-8?q?already=20includes=20the=20encryption=20header)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/extractFileStream.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ssn/extractFileStream.ts b/src/ssn/extractFileStream.ts index a934d85..7298329 100644 --- a/src/ssn/extractFileStream.ts +++ b/src/ssn/extractFileStream.ts @@ -31,9 +31,8 @@ export default function extractFileStream(file: ISsnFileEntry, inputStream: stre let curStream = inputStream; - const storedSize = (file.decryptionKeys !== undefined) ? (12 + file.compressedSize) : file.compressedSize; //set max length (including random 12 byte encryption header) - const maxLength = streamSetMaxLength(curStream, storedSize); + const maxLength = streamSetMaxLength(curStream, file.compressedSize); curStream = maxLength; //pipe into decryption if file is encrypted