From 6fcb2029fe1c7a432933727ae70f768117ec8168 Mon Sep 17 00:00:00 2001 From: souldbminersmwc Date: Sat, 30 May 2026 20:34:18 -0400 Subject: [PATCH] hocclk: fix array OOB --- .../overlay/src/ui/gui/freq_choice_gui.cpp | 10 ++----- Source/hoc-clk/overlay/src/ui/gui/labels.cpp | 26 +++++++++++++++---- Source/hoc-clk/overlay/src/ui/gui/labels.h | 4 ++- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Source/hoc-clk/overlay/src/ui/gui/freq_choice_gui.cpp b/Source/hoc-clk/overlay/src/ui/gui/freq_choice_gui.cpp index 94a28d85..4628d075 100644 --- a/Source/hoc-clk/overlay/src/ui/gui/freq_choice_gui.cpp +++ b/Source/hoc-clk/overlay/src/ui/gui/freq_choice_gui.cpp @@ -163,20 +163,14 @@ void FreqChoiceGui::listUI() if (IsMariko()) { unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2398 : 1964; - if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) { - unsafe_gpu = 1076; - } else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) { - unsafe_gpu = 1153; - } else { - unsafe_gpu = 1229; - } + unsafe_gpu = 1229; danger_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2500 : 2398; danger_gpu = 1306; } else { unsafe_cpu = this->configList->values[KipConfigValue_eristaCpuUV] ? 2092 : 1786; - if(this->configList->values[KipConfigValue_eristaGpuUV] == 0) { + if(this->configList->values[KipConfigValue_eristaGpuUV] == GPUUVLevel_NoUV) { unsafe_gpu = 922; } else { unsafe_gpu = 961; diff --git a/Source/hoc-clk/overlay/src/ui/gui/labels.cpp b/Source/hoc-clk/overlay/src/ui/gui/labels.cpp index de3b11ad..166c313e 100644 --- a/Source/hoc-clk/overlay/src/ui/gui/labels.cpp +++ b/Source/hoc-clk/overlay/src/ui/gui/labels.cpp @@ -93,24 +93,38 @@ std::map gpu_freq_label_m = { {460800000, "Handheld"}, {614400000, "Handheld Safe Max"}, {768000000, "Docked"}, - {1075200000, "Safe Max"}, - {1305600000, "Unsafe Max"}, - {1536000000, "Absolute Max"}, + {998400000, "Safe Max"}, }; std::map gpu_freq_label_m_slt = { {76800000, "Boost Mode"}, {307200000, "Handheld"}, + {345600000, "Handheld"}, {384000000, "Handheld"}, + {422400000, "Handheld"}, {460800000, "Handheld"}, {614400000, "Handheld Safe Max"}, {768000000, "Docked"}, - {1152200000, "Safe Max"}, + {1075200000, "Safe Max"}, {1305600000, "Unsafe Max"}, {1536000000, "Absolute Max"}, }; std::map gpu_freq_label_m_hiopt = { + {76800000, "Boost Mode"}, + {307200000, "Handheld"}, + {345600000, "Handheld"}, + {384000000, "Handheld"}, + {422400000, "Handheld"}, + {460800000, "Handheld"}, + {614400000, "Handheld Safe Max"}, + {768000000, "Docked"}, + {1152000000, "Safe Max"}, + {1305600000, "Unsafe Max"}, + {1536000000, "Absolute Max"}, +}; + +std::map gpu_freq_label_m_highuv = { {76800000, "Boost Mode"}, {307200000, "Handheld"}, {384000000, "Handheld"}, @@ -122,10 +136,12 @@ std::map gpu_freq_label_m_hiopt = { {1536000000, "Absolute Max"}, }; -std::map* marikoUV[3] { +std::map* marikoUV[5] { &gpu_freq_label_m, &gpu_freq_label_m_slt, &gpu_freq_label_m_hiopt, + &gpu_freq_label_m_hiopt, + &gpu_freq_label_m_highuv, }; diff --git a/Source/hoc-clk/overlay/src/ui/gui/labels.h b/Source/hoc-clk/overlay/src/ui/gui/labels.h index bbebef02..5c087026 100644 --- a/Source/hoc-clk/overlay/src/ui/gui/labels.h +++ b/Source/hoc-clk/overlay/src/ui/gui/labels.h @@ -27,8 +27,10 @@ extern std::map cpu_freq_label_e_uv; extern std::map gpu_freq_label_m; extern std::map gpu_freq_label_m_slt; extern std::map gpu_freq_label_m_hiopt; +extern std::map gpu_freq_label_m_highuv; + extern std::map gpu_freq_label_e; extern std::map gpu_freq_label_e_uv; -extern std::map* marikoUV[3]; +extern std::map* marikoUV[5]; extern std::map* eristaUV[3]; \ No newline at end of file