Skip to content

Commit

Permalink
JS: Fix seeking to end on large files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Aug 26, 2024
1 parent 7f4107c commit 9a37181
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Js_DiscImageDeviceStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ void CJsDiscImageDeviceStream::Seek(int64 position, Framework::STREAM_SEEK_DIREC
m_position += position;
break;
case Framework::STREAM_SEEK_END:
m_position = MAIN_THREAD_EM_ASM_INT({return Module.discImageDevice.getFileSize()});
{
uint32 positionLo = MAIN_THREAD_EM_ASM_INT({return Module.discImageDevice.getFileSize()});
uint32 positionHi = MAIN_THREAD_EM_ASM_INT({return Module.discImageDevice.getFileSize() / 4294967296});
m_position = static_cast<uint64>(positionLo) | (static_cast<uint64>(positionHi) << 32);
}
break;
}
}
Expand Down

0 comments on commit 9a37181

Please sign in to comment.