Skip to content

Commit

Permalink
convert: fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Oct 6, 2021
1 parent 0cf2225 commit 903e70a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ntfs2btrfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3373,9 +3373,12 @@ static void convert(ntfs& dev, enum btrfs_compression compression, enum btrfs_cs
while (!runs.empty() && (runs.rbegin()->second.back().offset * cluster_size) + runs.rbegin()->second.back().length > device_size) {
auto& r = runs.rbegin()->second;

if (r.back().offset * cluster_size >= orig_device_size)
if (r.back().offset * cluster_size >= orig_device_size) {
r.pop_back();
else {

if (r.empty())
runs.erase(prev(runs.end()));
} else {
uint64_t len = orig_device_size - (r.back().offset * cluster_size);

if (len % cluster_size)
Expand Down

0 comments on commit 903e70a

Please sign in to comment.