From 7604ae67ffd4e5787cb0d349a5f0d6184b39dc17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 31 Aug 2026 13:02:53 +0200 Subject: [PATCH] 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. --- GPU/Common/FramebufferManagerCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index d68c428a07..74412aa820 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -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; } }