Skip to content

Commit 70bb57a

Browse files
jgautier-anssifabienfl-orc
authored andcommittedMay 5, 2023
OrcLib: MemoryStream: fix method Duplicate
1 parent 1de7834 commit 70bb57a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎src/OrcLib/MemoryStream.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ HRESULT MemoryStream::Duplicate(const MemoryStream& other)
8484
m_cbBufferCommitSize = other.m_cbBufferCommitSize;
8585
m_dwCurrFilePointer = 0LL;
8686
}
87+
88+
ULONG64 ullCurPos = 0LLU;
89+
auto hr = const_cast<MemoryStream*>(&other)->SetFilePointer(0LL, FILE_CURRENT, &ullCurPos);
90+
if (FAILED(hr))
91+
{
92+
return hr;
93+
}
94+
95+
ULONG64 ullDupCurPos = 0LLU;
96+
hr = SetFilePointer(ullCurPos, FILE_BEGIN, &ullDupCurPos);
97+
if (FAILED(hr))
98+
{
99+
return hr;
100+
}
101+
87102
return S_OK;
88103
}
89104

0 commit comments

Comments
 (0)
Please sign in to comment.