morton_swizzle: Avoid buffer underflow

* Check the y coordinate before decrementing linear_buffer
This commit is contained in:
emufan4568
2022-09-07 23:44:36 +03:00
committed by GPUCode
parent 993d172de9
commit 04b927ab7f

View File

@ -90,7 +90,11 @@ static void MortonCopy(u32 stride, u32 height, u8* linear_buffer, PAddr base, PA
x = (x + 8) % stride;
linear_buffer += 8 * aligned_bytes_per_pixel;
if (!x) {
y += 8;
y = (y + 8) % height;
if (!y) {
return;
}
linear_buffer -= stride * 9 * aligned_bytes_per_pixel;
}
};