mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 08:11:48 +01:00
Fix UB with guest-less Texture/Buffers in MarkGpuDirty
As there was no check for the lack of a `GuestTexture`/`GuestBuffer`, it would lead to UB when a texture/buffer that had no guest such as the `zeroTexture` from `GraphicsContext` would be marked as dirty they would cause a call to `NCE::RetrapRegions` with a `nullptr` handle that would be dereferenced and cause a segmentation fault.
This commit is contained in:
parent
372ab8befa
commit
8ccef733ff
@ -45,7 +45,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
void Buffer::MarkGpuDirty() {
|
||||
if (dirtyState == DirtyState::GpuDirty || externallySynchronized) {
|
||||
if (dirtyState == DirtyState::GpuDirty || externallySynchronized || !guest) {
|
||||
externallySynchronized = false; // We want to handle synchronize internally after the GPU work is done
|
||||
return;
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
void Texture::MarkGpuDirty() {
|
||||
if (dirtyState == DirtyState::GpuDirty)
|
||||
if (dirtyState == DirtyState::GpuDirty || !guest)
|
||||
return;
|
||||
gpu.state.nce->RetrapRegions(*trapHandle, false);
|
||||
dirtyState = DirtyState::GpuDirty;
|
||||
|
Loading…
Reference in New Issue
Block a user