display-fx: protect vertical lines against clipping out of bounds

This commit is contained in:
Lephe 2020-10-05 15:13:38 +02:00
parent 9b462deca1
commit 2e8b1020cb
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ void gint_dvline(int y1, int y2, int x, int color)
if((uint)x >= 128) return;
if(y1 > y2) swap(y1, y2);
if(y1 >= 64 || y2 < 0) return;
if(y1 < 0) y1 = 0;
if(y2 >= 64) y2 = 63;
uint32_t *base = gint_vram + (y1 << 2) + (x >> 5);
uint32_t *lword = base + ((y2 - y1 + 1) << 2);