Skip to content

Commit

Permalink
Application: Oodle decompression fix caused by 6bf31e6
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed May 18, 2024
1 parent 7809459 commit 8a13bdb
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -735,18 +735,19 @@ private void fill() throws IOException {
}

final ChunkEntry chunk = chunks[index];
final ByteBuffer buffer = ByteBuffer.allocate(chunk.compressed().size());
final ByteBuffer src = ByteBuffer.allocate(chunk.compressed().size());
final ByteBuffer dst = ByteBuffer.wrap(decompressed, 0, chunk.decompressed().size());

synchronized (Packfile.this) {
channel.position(chunk.compressed().offset());
channel.read(buffer.slice());
channel.read(src.slice());
}

if (header.isEncrypted()) {
chunk.swizzle(buffer.slice());
chunk.swizzle(src.slice());
}

compressor.decompress(buffer, ByteBuffer.wrap(decompressed));
compressor.decompress(src, dst);

if (index == 0) {
pos = (int) (file.span().offset() - chunk.decompressed().offset());
Expand Down

0 comments on commit 8a13bdb

Please sign in to comment.