Skip to content

Commit

Permalink
Check fileOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
roggiezhang-nv committed Jan 9, 2025
1 parent 2b26e6c commit a555836
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pxr/usd/plugin/usdAbc/alembicReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,9 @@ _ReaderContext::_OpenAndGetMappedFilePath(const std::string& filePath)
ArGetResolver().OpenAsset(ArResolvedPath(filePath));
if (asset)
{
FILE* fileHandle = asset->GetFileUnsafe().first;
if (fileHandle && ftell(fileHandle) == 0)
FILE* fileHandle; size_t fileOffset;
std::tie(fileHandle, fileOffset) = asset->GetFileUnsafe();
if (fileHandle && fileOffset == 0)
{
// If file handle is presented, use mapped file path instead of original one.
const std::string mappedFilePath = ArchGetFileName(fileHandle);
Expand Down

0 comments on commit a555836

Please sign in to comment.