summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2022-04-02 22:38:58 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-10-06 21:00:53 +0200
commit7cfa28a6664fa79b5b12341a93e995d74cb0deef (patch)
tree3a32af47e26d3e62223e6558ccb49d1fdd521c7e /src/video_core
parentMemoryManager: Fix errors popping out. (diff)
downloadyuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar.gz
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar.bz2
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar.lz
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar.xz
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.tar.zst
yuzu-7cfa28a6664fa79b5b12341a93e995d74cb0deef.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/memory_manager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp
index 0f97db272..4e52ce0fd 100644
--- a/src/video_core/memory_manager.cpp
+++ b/src/video_core/memory_manager.cpp
@@ -193,6 +193,9 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) {
}
std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) const {
+ if (gpu_addr >= address_space_size) [[unlikely]] {
+ return std::nullopt;
+ }
if (GetEntry<true>(gpu_addr) != EntryType::Mapped) [[unlikely]] {
if (GetEntry<false>(gpu_addr) != EntryType::Mapped) {
return std::nullopt;