mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
fix: Corrupted Cache Cleanup
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2026 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -692,10 +693,17 @@ void LoadPipelines(
|
|||||||
}
|
}
|
||||||
u32 num_envs{};
|
u32 num_envs{};
|
||||||
file.read(reinterpret_cast<char*>(&num_envs), sizeof(num_envs));
|
file.read(reinterpret_cast<char*>(&num_envs), sizeof(num_envs));
|
||||||
|
|
||||||
|
if (num_envs == 0 || num_envs > 64) {
|
||||||
|
LOG_ERROR(Common_Filesystem, "Corrupted shader cache detected: num_envs={}", num_envs);
|
||||||
|
throw std::ios_base::failure("Corrupted num_envs");
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<FileEnvironment> envs(num_envs);
|
std::vector<FileEnvironment> envs(num_envs);
|
||||||
for (FileEnvironment& env : envs) {
|
for (FileEnvironment& env : envs) {
|
||||||
env.Deserialize(file);
|
env.Deserialize(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (envs.front().ShaderStage() == Shader::Stage::Compute) {
|
if (envs.front().ShaderStage() == Shader::Stage::Compute) {
|
||||||
load_compute(file, std::move(envs.front()));
|
load_compute(file, std::move(envs.front()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user