Fix decrypted reading with the offset is bigger than UINT32_MAX

This commit is contained in:
Maschell 2022-08-05 18:45:38 +02:00
parent f09f8f2b29
commit 6899987864

View File

@ -81,7 +81,7 @@ bool DiscReader::readDecrypted(uint8_t *out_buffer, uint64_t clusterOffset, uint
uint32_t blockNumber = (totalOffset / BLOCK_SIZE); uint32_t blockNumber = (totalOffset / BLOCK_SIZE);
uint32_t blockOffset = (totalOffset % BLOCK_SIZE); uint32_t blockOffset = (totalOffset % BLOCK_SIZE);
readOffset = (blockNumber * BLOCK_SIZE); readOffset = ((uint64_t) blockNumber * BLOCK_SIZE);
if (!useFixedIV) { if (!useFixedIV) {
memset(usedIV, 0, 16); memset(usedIV, 0, 16);
uint64_t ivTemp = usedFileOffset >> 16; uint64_t ivTemp = usedFileOffset >> 16;