1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Decompress functions not extracting full data

Thanks a lot to tocklime
This commit is contained in:
WerWolv 2024-03-22 17:34:49 +01:00
parent 28ea91e6c3
commit 9b9f7e2a1d

View File

@ -80,9 +80,10 @@ namespace hex::plugin::decompress {
if (stream.avail_out != 0)
break;
section.resize(section.size() * 2);
stream.next_out = section.data();
stream.avail_out = section.size();
const auto prevSectionSize = section.size();
section.resize(prevSectionSize * 2);
stream.next_out = section.data() + prevSectionSize;
stream.avail_out = prevSectionSize;
}
return true;
@ -126,9 +127,10 @@ namespace hex::plugin::decompress {
if (stream.avail_out != 0)
break;
section.resize(section.size() * 2);
stream.next_out = reinterpret_cast<char*>(section.data());
stream.avail_out = section.size();
const auto prevSectionSize = section.size();
section.resize(prevSectionSize * 2);
stream.next_out = reinterpret_cast<char*>(section.data()) + prevSectionSize;
stream.avail_out = prevSectionSize;
}
return true;
@ -173,9 +175,10 @@ namespace hex::plugin::decompress {
if (stream.avail_out != 0)
break;
section.resize(section.size() * 2);
stream.next_out = compressedData.data();
stream.avail_out = compressedData.size();
const auto prevSectionSize = section.size();
section.resize(prevSectionSize * 2);
stream.next_out = section.data() + prevSectionSize;
stream.avail_out = prevSectionSize;
}
return true;