Skip to content

Commit

Permalink
Fix writing of large sized ISO images
Browse files Browse the repository at this point in the history
Correctly handle offset calculation.

Fixes #793
  • Loading branch information
grulja committed Jan 3, 2025
1 parent df0ad49 commit 208df08
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/helper/win/writejob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,9 @@ bool WriteJob::writePlain(HANDLE driveHandle)
return false;
}

if (osWrite.Offset + blockSize < osWrite.Offset) {
osWrite.OffsetHigh++;
}
osWrite.Offset += blockSize;
uint64_t newOffset = (static_cast<uint64_t>(osWrite.OffsetHigh) << 32) + osWrite.Offset + readBytes;
osWrite.Offset = static_cast<DWORD>(newOffset & 0xFFFFFFFF);
osWrite.OffsetHigh = static_cast<DWORD>(newOffset >> 32);

totalBytes += readBytes;
m_out << totalBytes << "\n";
Expand Down

0 comments on commit 208df08

Please sign in to comment.