diff options
| author | 2018-06-22 11:18:23 +0300 | |
|---|---|---|
| committer | 2018-06-22 11:28:10 +0300 | |
| commit | a27befe456b8c9cb95bd922ea9a2613cfb473009 (patch) | |
| tree | f50f9bdd0eec1b8a0692b283ce31b2c55c6209fe /src/core | |
| parent | Merge pull request #577 from mailwl/audren-update (diff) | |
| download | yuzu-a27befe456b8c9cb95bd922ea9a2613cfb473009.tar.gz yuzu-a27befe456b8c9cb95bd922ea9a2613cfb473009.tar.xz yuzu-a27befe456b8c9cb95bd922ea9a2613cfb473009.zip | |
IPC: skip empty buffer write
prevent yuzu crash, if games, like Axiom Verge, trying to read 0 bytes from file
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 01904467e..b0d83f401 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -271,6 +271,11 @@ std::vector<u8> HLERequestContext::ReadBuffer(int buffer_index) const { | |||
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | size_t HLERequestContext::WriteBuffer(const void* buffer, size_t size, int buffer_index) const { | 273 | size_t HLERequestContext::WriteBuffer(const void* buffer, size_t size, int buffer_index) const { |
| 274 | if (size == 0) { | ||
| 275 | NGLOG_WARNING(Core, "skip empty buffer write"); | ||
| 276 | return 0; | ||
| 277 | } | ||
| 278 | |||
| 274 | const bool is_buffer_b{BufferDescriptorB().size() && BufferDescriptorB()[buffer_index].Size()}; | 279 | const bool is_buffer_b{BufferDescriptorB().size() && BufferDescriptorB()[buffer_index].Size()}; |
| 275 | const size_t buffer_size{GetWriteBufferSize(buffer_index)}; | 280 | const size_t buffer_size{GetWriteBufferSize(buffer_index)}; |
| 276 | if (size > buffer_size) { | 281 | if (size > buffer_size) { |