Skip to content

Commit

Permalink
[MCAP] Bugfix: fixed ZSTD decompression.
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainBertrand committed Feb 22, 2024
1 parent 86f0081 commit e8d065b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void readMessagesAtCurrentTimestamp() throws IOException
List<MCAP.Message> messages = messageManager.loadMessages(currentTimestamp.getValue());
if (messages == null)
{
LogTools.error("No messages at timestamp {}.", currentTimestamp.getValue());
LogTools.warn("No messages at timestamp {}.", currentTimestamp.getValue());
return;
}
currentChunkStartTimestamp.set(messageManager.getActiveChunkStartTimestamp());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public ByteBuffer getByteBuffer(long offset, int length, boolean direct)
@Override
public ByteBuffer getDecompressedByteBuffer(long offset, int compressedLength, int uncompressedLength, Compression compression, boolean direct)
{
ByteBuffer compressedBuffer = getByteBuffer(offset, compressedLength, false);
ByteBuffer decompressedBuffer;

if (compression == Compression.LZ4)
Expand All @@ -101,7 +100,7 @@ else if (compression == Compression.ZSTD)
int previousLimit = buffer.limit();
buffer.limit((int) (offset + compressedLength));
buffer.position((int) offset);
decompressedBuffer = zstdDecompressCtx.decompress(compressedBuffer, uncompressedLength);
decompressedBuffer = zstdDecompressCtx.decompress(buffer, uncompressedLength);
buffer.position(previousPosition);
buffer.limit(previousLimit);
}
Expand Down

0 comments on commit e8d065b

Please sign in to comment.