mirror of
https://github.com/mupen64plus-ae/mupen64plus-video-glide64mk2.git
synced 2024-11-23 05:29:46 +00:00
Protect against out of bounds access in ucode02
This commit is contained in:
parent
08554ba969
commit
7c2820bce6
@ -230,10 +230,21 @@ static void uc2_culldl ()
|
||||
{
|
||||
wxUint16 vStart = (wxUint16)(rdp.cmd0 & 0xFFFF) >> 1;
|
||||
wxUint16 vEnd = (wxUint16)(rdp.cmd1 & 0xFFFF) >> 1;
|
||||
|
||||
// Protect against out of bounds access
|
||||
vStart &= MAX_VTX - 1;
|
||||
vEnd &= MAX_VTX - 1;
|
||||
|
||||
wxUint32 cond = 0;
|
||||
FRDP ("uc2:culldl start: %d, end: %d\n", vStart, vEnd);
|
||||
|
||||
if (vEnd < vStart) return;
|
||||
if (vEnd < vStart) {
|
||||
// Aidyn Chronicles - The First Mage seems to pass parameters in reverse order.
|
||||
const wxUint16 vTemp = vStart;
|
||||
vStart = vEnd;
|
||||
vEnd = vTemp;
|
||||
}
|
||||
|
||||
for (wxUint16 i=vStart; i<=vEnd; i++)
|
||||
{
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user