Fix overflow crashes in certain cases

This commit is contained in:
Cacodemon345
2025-09-21 17:39:40 +06:00
committed by GitHub
parent e736dbc694
commit 0b0bf2e438

View File

@@ -155,7 +155,7 @@ svga_render_text_40(svga_t *svga)
svga->lastline_draw = svga->displine;
if (svga->fullchange) {
p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add];
p = &svga->monitor->target_buffer->line[(svga->displine + svga->y_add) & 2047][(svga->x_add) & 2047];
xinc = (svga->seqregs[1] & 1) ? 16 : 18;
for (int x = 0; x < (svga->hdisp + svga->scrollcache); x += xinc) {
@@ -238,7 +238,7 @@ svga_render_text_80(svga_t *svga)
svga->lastline_draw = svga->displine;
if (svga->fullchange) {
p = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add];
p = &svga->monitor->target_buffer->line[(svga->displine + svga->y_add) & 2047][(svga->x_add) & 2047];
xinc = (svga->seqregs[1] & 1) ? 8 : 9;
static uint32_t col = 0x00000000;