hocclk: fix array OOB

This commit is contained in:
souldbminersmwc
2026-05-30 20:34:18 -04:00
parent d21391fe79
commit 6fcb2029fe
3 changed files with 26 additions and 14 deletions

View File

@@ -163,20 +163,14 @@ void FreqChoiceGui::listUI()
if (IsMariko()) if (IsMariko())
{ {
unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2398 : 1964; unsafe_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2398 : 1964;
if(this->configList->values[KipConfigValue_marikoGpuUV] == 0) { unsafe_gpu = 1229;
unsafe_gpu = 1076;
} else if (this->configList->values[KipConfigValue_marikoGpuUV] == 1) {
unsafe_gpu = 1153;
} else {
unsafe_gpu = 1229;
}
danger_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2500 : 2398; danger_cpu = this->configList->values[KipConfigValue_marikoCpuUVHigh] ? 2500 : 2398;
danger_gpu = 1306; danger_gpu = 1306;
} }
else else
{ {
unsafe_cpu = this->configList->values[KipConfigValue_eristaCpuUV] ? 2092 : 1786; 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; unsafe_gpu = 922;
} else { } else {
unsafe_gpu = 961; unsafe_gpu = 961;

View File

@@ -93,24 +93,38 @@ std::map<uint32_t, std::string> gpu_freq_label_m = {
{460800000, "Handheld"}, {460800000, "Handheld"},
{614400000, "Handheld Safe Max"}, {614400000, "Handheld Safe Max"},
{768000000, "Docked"}, {768000000, "Docked"},
{1075200000, "Safe Max"}, {998400000, "Safe Max"},
{1305600000, "Unsafe Max"},
{1536000000, "Absolute Max"},
}; };
std::map<uint32_t, std::string> gpu_freq_label_m_slt = { std::map<uint32_t, std::string> gpu_freq_label_m_slt = {
{76800000, "Boost Mode"}, {76800000, "Boost Mode"},
{307200000, "Handheld"}, {307200000, "Handheld"},
{345600000, "Handheld"},
{384000000, "Handheld"}, {384000000, "Handheld"},
{422400000, "Handheld"},
{460800000, "Handheld"}, {460800000, "Handheld"},
{614400000, "Handheld Safe Max"}, {614400000, "Handheld Safe Max"},
{768000000, "Docked"}, {768000000, "Docked"},
{1152200000, "Safe Max"}, {1075200000, "Safe Max"},
{1305600000, "Unsafe Max"}, {1305600000, "Unsafe Max"},
{1536000000, "Absolute Max"}, {1536000000, "Absolute Max"},
}; };
std::map<uint32_t, std::string> gpu_freq_label_m_hiopt = { std::map<uint32_t, std::string> 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<uint32_t, std::string> gpu_freq_label_m_highuv = {
{76800000, "Boost Mode"}, {76800000, "Boost Mode"},
{307200000, "Handheld"}, {307200000, "Handheld"},
{384000000, "Handheld"}, {384000000, "Handheld"},
@@ -122,10 +136,12 @@ std::map<uint32_t, std::string> gpu_freq_label_m_hiopt = {
{1536000000, "Absolute Max"}, {1536000000, "Absolute Max"},
}; };
std::map<uint32_t, std::string>* marikoUV[3] { std::map<uint32_t, std::string>* marikoUV[5] {
&gpu_freq_label_m, &gpu_freq_label_m,
&gpu_freq_label_m_slt, &gpu_freq_label_m_slt,
&gpu_freq_label_m_hiopt, &gpu_freq_label_m_hiopt,
&gpu_freq_label_m_hiopt,
&gpu_freq_label_m_highuv,
}; };

View File

@@ -27,8 +27,10 @@ extern std::map<uint32_t, std::string> cpu_freq_label_e_uv;
extern std::map<uint32_t, std::string> gpu_freq_label_m; extern std::map<uint32_t, std::string> gpu_freq_label_m;
extern std::map<uint32_t, std::string> gpu_freq_label_m_slt; extern std::map<uint32_t, std::string> gpu_freq_label_m_slt;
extern std::map<uint32_t, std::string> gpu_freq_label_m_hiopt; extern std::map<uint32_t, std::string> gpu_freq_label_m_hiopt;
extern std::map<uint32_t, std::string> gpu_freq_label_m_highuv;
extern std::map<uint32_t, std::string> gpu_freq_label_e; extern std::map<uint32_t, std::string> gpu_freq_label_e;
extern std::map<uint32_t, std::string> gpu_freq_label_e_uv; extern std::map<uint32_t, std::string> gpu_freq_label_e_uv;
extern std::map<uint32_t, std::string>* marikoUV[3]; extern std::map<uint32_t, std::string>* marikoUV[5];
extern std::map<uint32_t, std::string>* eristaUV[3]; extern std::map<uint32_t, std::string>* eristaUV[3];