2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #1830 from Subv/vi_ub

Services/VI: Dereferencing an uninitialized std::optional is undefined behavior.
This commit is contained in:
bunnei 2018-12-01 22:25:10 -05:00 committed by GitHub
commit 97e73591e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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