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
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

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);