FramebufferManagerCommon: don't deref dstRect.vfb when no dst buffer was found

A failed FindTransferFramebuffer leaves dstRect zero-initialized, and RASTER_COLOR is
0, so the channel check passes and vfb is read through a null pointer. Only reachable
for a depth-source transfer to an address with no matching framebuffer.
Check dstBuffer first, like every other use of dstRect.vfb below.
This commit is contained in:
Henrik Rydgård committed 2026-08-31 13:02:53 +02:00
1 parent a99ab6f6f6
commit 7604ae67ff
1 file changed
+1 -1
+1 -1
View File
@@ -2609,7 +2609,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst
if (srcRect.channel == RASTER_DEPTH) {
// Ignore the found buffer if it's not 16-bit - we create a new more suitable one instead.
if (dstRect.channel == RASTER_COLOR && dstRect.vfb->fb_format == GE_FORMAT_8888) {
if (dstBuffer && dstRect.channel == RASTER_COLOR && dstRect.vfb->fb_format == GE_FORMAT_8888) {
dstBuffer = false;
}
}