fix(vhd-lib/createVhdStreamWithLength): don't call readChunkStrict with 0

Introduced by c26a7a3e5
This commit is contained in:
Julien Fontanet
2023-03-30 14:34:10 +02:00
parent 43b6285437
commit 4e9477f34a

View File

@@ -41,10 +41,12 @@ module.exports = async function createVhdStreamWithLength(stream) {
let streamPosition = 0
async function readStream(length) {
const chunk = await readChunkStrict(stream, length)
streamPosition += length
readBuffers.push(chunk)
return chunk
if (length !== 0) {
const chunk = await readChunkStrict(stream, length)
streamPosition += length
readBuffers.push(chunk)
return chunk
}
}
const footerBuffer = await readStream(FOOTER_SIZE)