From 10061aa22c661a191984ebbe862a2532671717c2 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 2 Jun 2023 20:06:07 +0200 Subject: [PATCH] VI: Prevent out-of-bounds access when clock register is a nonstandard value. --- Source/Core/Core/HW/VideoInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index d3ec094a35..68b6564f86 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -717,7 +717,7 @@ u32 VideoInterfaceManager::GetTargetRefreshRateDenominator() 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