summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-01 22:25:10 -0500
committerGitHub <noreply@github.com>2018-12-01 22:25:10 -0500
commit97e73591e3fb2705cbbd4fcbc33267d598fbba93 (patch)
tree55756ed97c50e705d5c1d13ec9c8383ff8323538
parente88cdcc912ae6929f9008c1b307c62f1e7b0637f (diff)
parent583bd20f02fabb2b41f42d2ae8feb1994c0e4fb4 (diff)
Merge pull request #1830 from Subv/vi_ub
Services/VI: Dereferencing an uninitialized std::optional is undefined behavior.
-rw-r--r--src/core/hle/service/vi/vi.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 5120abfff..412d5b0c9 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -542,6 +542,8 @@ private:
// Repeat TransactParcel DequeueBuffer when a buffer is available
auto buffer_queue = nv_flinger->GetBufferQueue(id);
std::optional<u32> slot = buffer_queue->DequeueBuffer(width, height);
+ ASSERT_MSG(slot != std::nullopt, "Could not dequeue buffer.");
+
IGBPDequeueBufferResponseParcel response{*slot};
ctx.WriteBuffer(response.Serialize());
IPC::ResponseBuilder rb{ctx, 2};