fix potential out-of-bounds write
This commit is contained in:
parent
ff27036b35
commit
22f3cae067
|
@ -284,6 +284,7 @@ void SetDisplaySettings(bool accel)
|
|||
if (Framebuffer[1][0]) delete[] Framebuffer[1][0];
|
||||
if (Framebuffer[0][1]) delete[] Framebuffer[0][1];
|
||||
if (Framebuffer[1][1]) delete[] Framebuffer[1][1];
|
||||
|
||||
Framebuffer[0][0] = new u32[fbsize];
|
||||
Framebuffer[1][0] = new u32[fbsize];
|
||||
Framebuffer[0][1] = new u32[fbsize];
|
||||
|
|
|
@ -753,8 +753,10 @@ void GPU2D::DrawScanline(u32 line)
|
|||
|
||||
case 1: // regular display
|
||||
{
|
||||
for (int i = 0; i < stride; i+=2)
|
||||
int i = 0;
|
||||
for (; i < (stride & ~1); i+=2)
|
||||
*(u64*)&dst[i] = *(u64*)&BGOBJLine[i];
|
||||
if (stride & 1) dst[i] = BGOBJLine[i];
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue