Commit 9181ab19 authored by RSDuck's avatar RSDuck
Browse files

GPU3D soft: prevent out of bounds read

parent f271bdf3
......@@ -1066,7 +1066,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
{
if (!(dstattr & 0x3)) continue;
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
pixeladdr += BufferSize;
dstattr = AttrBuffer[pixeladdr];
......@@ -1162,7 +1162,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
{
if (!(dstattr & 0x3)) continue;
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
pixeladdr += BufferSize;
dstattr = AttrBuffer[pixeladdr];
......@@ -1237,7 +1237,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
{
if (!(dstattr & 0x3)) continue;
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
pixeladdr += BufferSize;
dstattr = AttrBuffer[pixeladdr];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment