🐛 Fix compressed size (it already includes the encryption header)

This commit is contained in:
C-3PO 2018-07-05 03:13:51 +02:00
parent 02f4d3ecb5
commit 1230330ce1
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -31,9 +31,8 @@ export default function extractFileStream(file: ISsnFileEntry, inputStream: stre
let curStream = inputStream; let curStream = inputStream;
const storedSize = (file.decryptionKeys !== undefined) ? (12 + file.compressedSize) : file.compressedSize;
//set max length (including random 12 byte encryption header) //set max length (including random 12 byte encryption header)
const maxLength = streamSetMaxLength(curStream, storedSize); const maxLength = streamSetMaxLength(curStream, file.compressedSize);
curStream = maxLength; curStream = maxLength;
//pipe into decryption if file is encrypted //pipe into decryption if file is encrypted