Propagate framebuffer tile readback failures before copying pixels

This commit is contained in:
Leonardo Zide committed 2026-10-05 13:33:16 -07:00
1 parent 1e9b0df568
commit 45de08aaae
1 file changed
+15 -2
+15 -2
View File
@@ -998,9 +998,22 @@ void lcView::OnDraw()
UnbindRenderFramebuffer();
QImage TileImage = GetRenderFramebufferImage();
BindRenderFramebuffer();
quint8* Buffer = TileImage.bits();
if (TileImage.isNull())
{
mRenderImage = QImage();
return;
}
const quint8* Buffer = TileImage.constBits();
uchar* ImageBuffer = mRenderImage.bits();
if (!ImageBuffer)
{
mRenderImage = QImage();
return;
}
quint32 TileY = 0, SrcY = 0;
if (CurrentTileRow != TotalTileRows - 1)
TileY = (TotalTileRows - CurrentTileRow - 1) * mHeight - ((mHeight - mRenderImage.height() % mHeight) % mHeight);
@@ -1011,7 +1024,7 @@ void lcView::OnDraw()
for (int y = 0; y < CurrentTileHeight; y++)
{
quint8* src = Buffer + (SrcY + y) * mWidth * 4;
const quint8* src = Buffer + (SrcY + y) * mWidth * 4;
quint8* dst = ImageBuffer + TileStart + y * mRenderImage.width() * 4;
memcpy(dst, src, CurrentTileWidth * 4);