video_core: Assert on invalid GPU to CPU address queries

This commit is contained in:
ReinUsesLisp
2019-01-22 03:47:56 -03:00
parent 04e68e9738
commit 2bdbb90af7
8 changed files with 67 additions and 47 deletions

View File

@ -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);