mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 09:12:46 +01:00
Services/VI: Dereferencing an uninitialized std::optional is undefined behavior.
Assert that it is not empty before using it in the DequeueBuffer wait callback.
This commit is contained in:
parent
4b950728fd
commit
583bd20f02
1 changed files with 2 additions and 0 deletions
|
@ -542,6 +542,8 @@ private:
|
||||||
// Repeat TransactParcel DequeueBuffer when a buffer is available
|
// Repeat TransactParcel DequeueBuffer when a buffer is available
|
||||||
auto buffer_queue = nv_flinger->GetBufferQueue(id);
|
auto buffer_queue = nv_flinger->GetBufferQueue(id);
|
||||||
std::optional<u32> slot = buffer_queue->DequeueBuffer(width, height);
|
std::optional<u32> slot = buffer_queue->DequeueBuffer(width, height);
|
||||||
|
ASSERT_MSG(slot != std::nullopt, "Could not dequeue buffer.");
|
||||||
|
|
||||||
IGBPDequeueBufferResponseParcel response{*slot};
|
IGBPDequeueBufferResponseParcel response{*slot};
|
||||||
ctx.WriteBuffer(response.Serialize());
|
ctx.WriteBuffer(response.Serialize());
|
||||||
IPC::ResponseBuilder rb{ctx, 2};
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
|
Loading…
Reference in a new issue