mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
GPU3D soft: prevent out of bounds read
This commit is contained in:
@ -1066,7 +1066,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
|||||||
// against the pixel underneath
|
// against the pixel underneath
|
||||||
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
||||||
{
|
{
|
||||||
if (!(dstattr & 0x3)) continue;
|
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
|
||||||
|
|
||||||
pixeladdr += BufferSize;
|
pixeladdr += BufferSize;
|
||||||
dstattr = AttrBuffer[pixeladdr];
|
dstattr = AttrBuffer[pixeladdr];
|
||||||
@ -1162,7 +1162,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
|||||||
// against the pixel underneath
|
// against the pixel underneath
|
||||||
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
||||||
{
|
{
|
||||||
if (!(dstattr & 0x3)) continue;
|
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
|
||||||
|
|
||||||
pixeladdr += BufferSize;
|
pixeladdr += BufferSize;
|
||||||
dstattr = AttrBuffer[pixeladdr];
|
dstattr = AttrBuffer[pixeladdr];
|
||||||
@ -1237,7 +1237,7 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
|||||||
// against the pixel underneath
|
// against the pixel underneath
|
||||||
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
if (!fnDepthTest(DepthBuffer[pixeladdr], z, dstattr))
|
||||||
{
|
{
|
||||||
if (!(dstattr & 0x3)) continue;
|
if (!(dstattr & 0x3) || pixeladdr >= BufferSize) continue;
|
||||||
|
|
||||||
pixeladdr += BufferSize;
|
pixeladdr += BufferSize;
|
||||||
dstattr = AttrBuffer[pixeladdr];
|
dstattr = AttrBuffer[pixeladdr];
|
||||||
|
Reference in New Issue
Block a user