VI: Prevent out-of-bounds access when clock register is a nonstandard value.

This commit is contained in:
Admiral H. Curtiss 2023-06-02 20:06:07 +02:00
parent 7bbd530eb5
commit 10061aa22c
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB

View File

@ -717,7 +717,7 @@ u32 VideoInterfaceManager::GetTargetRefreshRateDenominator() const
u32 VideoInterfaceManager::GetTicksPerSample() const u32 VideoInterfaceManager::GetTicksPerSample() const
{ {
return 2 * SystemTimers::GetTicksPerSecond() / CLOCK_FREQUENCIES[m_clock]; return 2 * SystemTimers::GetTicksPerSecond() / CLOCK_FREQUENCIES[m_clock & 1];
} }
u32 VideoInterfaceManager::GetTicksPerHalfLine() const u32 VideoInterfaceManager::GetTicksPerHalfLine() const