From 2bdbb90af74683bd8bb7e25d5353c39fb8037f8c Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 22 Jan 2019 03:47:56 -0300 Subject: video_core: Assert on invalid GPU to CPU address queries --- src/video_core/dma_pusher.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/video_core/dma_pusher.cpp') diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 63a958f11..eb9bf1878 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp @@ -35,8 +35,10 @@ void DmaPusher::DispatchCalls() { bool DmaPusher::Step() { if (dma_get != dma_put) { // Push buffer non-empty, read a word - const CommandHeader command_header{ - Memory::Read32(*gpu.MemoryManager().GpuToCpuAddress(dma_get))}; + const auto address = gpu.MemoryManager().GpuToCpuAddress(dma_get); + ASSERT_MSG(address, "Invalid GPU address"); + + const CommandHeader command_header{Memory::Read32(*address)}; dma_get += sizeof(u32); -- cgit v1.2.3