diff options
| author | 2019-05-18 20:51:54 -0400 | |
|---|---|---|
| committer | 2019-05-19 10:48:31 -0400 | |
| commit | 9e98100c9493f5a04de45002e8b4b1cd07b2b685 (patch) | |
| tree | 20cd15c22ad9d0cb545f375dac1fc2ed5d9f03a1 /src/video_core/dma_pusher.cpp | |
| parent | Merge pull request #2457 from lioncash/about (diff) | |
| download | yuzu-9e98100c9493f5a04de45002e8b4b1cd07b2b685.tar.gz yuzu-9e98100c9493f5a04de45002e8b4b1cd07b2b685.tar.xz yuzu-9e98100c9493f5a04de45002e8b4b1cd07b2b685.zip | |
Dma_pusher: ASSERT on empty command_list
This is a measure to avoid crashes on command list reading as an empty
command_list is considered a NOP.
Diffstat (limited to 'src/video_core/dma_pusher.cpp')
| -rw-r--r-- | src/video_core/dma_pusher.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 036e66f05..3175579cc 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp | |||
| @@ -40,6 +40,13 @@ bool DmaPusher::Step() { | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | const CommandList& command_list{dma_pushbuffer.front()}; | 42 | const CommandList& command_list{dma_pushbuffer.front()}; |
| 43 | ASSERT_OR_EXECUTE(!command_list.empty(), { | ||
| 44 | // Somehow the command_list is empty, in order to avoid a crash | ||
| 45 | // We ignore it and assume its size is 0. | ||
| 46 | dma_pushbuffer.pop(); | ||
| 47 | dma_pushbuffer_subindex = 0; | ||
| 48 | return true; | ||
| 49 | }); | ||
| 43 | const CommandListHeader command_list_header{command_list[dma_pushbuffer_subindex++]}; | 50 | const CommandListHeader command_list_header{command_list[dma_pushbuffer_subindex++]}; |
| 44 | GPUVAddr dma_get = command_list_header.addr; | 51 | GPUVAddr dma_get = command_list_header.addr; |
| 45 | GPUVAddr dma_put = dma_get + command_list_header.size * sizeof(u32); | 52 | GPUVAddr dma_put = dma_get + command_list_header.size * sizeof(u32); |