Skip to content

Commit

Permalink
OrcLib: CacheStream: fix SetFilePointer when getting seek position
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienfl-orc committed Apr 25, 2024
1 parent f2a188a commit 0e15403
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/OrcLib/CacheStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ CacheStream::SetFilePointer(__in LONGLONG DistanceToMove, __in DWORD dwMoveMetho
pCurrPointer = &newOffset;
}

if (dwMoveMethod == FILE_CURRENT)
{
if (DistanceToMove == 0)
{
*pCurrPointer = m_offset;
return S_OK;
}

dwMoveMethod = FILE_BEGIN;
DistanceToMove = m_offset + DistanceToMove;
}

HRESULT hr = m_stream.SetFilePointer(DistanceToMove, dwMoveMethod, pCurrPointer);
if (FAILED(hr))
{
Expand Down

0 comments on commit 0e15403

Please sign in to comment.