mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
Added x/y bounds checking to gfxGetFramebufferDisplayOffset().
This commit is contained in:
parent
8f459cf958
commit
353faed782
@ -249,6 +249,9 @@ u32 gfxGetFramebufferDisplayOffset(u32 x, u32 y) {
|
|||||||
|
|
||||||
gfxGetFramebuffer(&width, &height);
|
gfxGetFramebuffer(&width, &height);
|
||||||
|
|
||||||
|
if (x >= width) x = width-1;
|
||||||
|
if (y >= height) y = height-1;
|
||||||
|
|
||||||
y = height-1-y;
|
y = height-1-y;
|
||||||
|
|
||||||
tilepos = ((y & 127) / 16) + (x/16*8) + ((y/16/8)*(width/16*8));
|
tilepos = ((y & 127) / 16) + (x/16*8) + ((y/16/8)*(width/16*8));
|
||||||
|
Loading…
Reference in New Issue
Block a user