Skip to content

Commit

Permalink
add_inode: handle case where compressed file is larger than uncompressed
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Jan 3, 2021
1 parent 2195f8f commit ecddf3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ntfs2btrfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ static void add_inode(root& r, uint64_t inode, uint64_t ntfs_inode, bool& is_dir
clusters += l;
}

inline_data += lznt1_decompress(compdata, compdata.length());
inline_data += lznt1_decompress(compdata, min(compdata.length(), file_size - inline_data.length()));

if (inline_data.length() >= file_size) {
inline_data.resize(file_size);
Expand Down

0 comments on commit ecddf3a

Please sign in to comment.