From 3cc036b7cd83d71bda371933f04b65a61104a52c Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 5 Jun 2023 00:41:00 -0400 Subject: [PATCH] Fix reports by CodeQL scanning --- src/video/vid_ati68860_ramdac.c | 2 +- src/video/vid_sigma.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index 7df04001c..107b63039 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -253,7 +253,7 @@ ati68860_hwcursor_draw(svga_t *svga, int displine) uint32_t col1 = ramdac->pallook[1]; offset = svga->dac_hwcursor_latch.xoff; - for (uint8_t x = 0; x < 64 - svga->dac_hwcursor_latch.xoff; x += 4) { + for (uint32_t x = 0; x < 64 - svga->dac_hwcursor_latch.xoff; x += 4) { dat = svga->vram[svga->dac_hwcursor_latch.addr + (offset >> 2)]; if (!(dat & 2)) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0; diff --git a/src/video/vid_sigma.c b/src/video/vid_sigma.c index 01979deba..a8f946e25 100644 --- a/src/video/vid_sigma.c +++ b/src/video/vid_sigma.c @@ -419,7 +419,7 @@ sigma_text80(sigma_t *sigma) /* The Sigma 400 seems to use screen widths stated in words (40 for 80-column, 20 for 40-column) */ - for (uint8_t x = 0; x < (sigma->crtc[1] << 1); x++) { + for (uint32_t x = 0; x < (sigma->crtc[1] << 1); x++) { chr = vram[x << 1]; attr = vram[(x << 1) + 1]; drawcursor = ((ma == ca) && sigma->con && sigma->cursoron); @@ -474,7 +474,7 @@ sigma_text40(sigma_t *sigma) /* The Sigma 400 seems to use screen widths stated in words (40 for 80-column, 20 for 40-column) */ - for (uint8_t x = 0; x < (sigma->crtc[1] << 1); x++) { + for (uint32_t x = 0; x < (sigma->crtc[1] << 1); x++) { chr = vram[x << 1]; attr = vram[(x << 1) + 1]; drawcursor = ((ma == ca) && sigma->con && sigma->cursoron); @@ -512,7 +512,7 @@ sigma_gfx400(sigma_t *sigma) uint8_t plane[4]; uint8_t col; - for (uint8_t x = 0; x < (sigma->crtc[1] << 1); x++) { + for (uint32_t x = 0; x < (sigma->crtc[1] << 1); x++) { plane[0] = vram[x]; plane[1] = vram[0x8000 + x]; plane[2] = vram[0x10000 + x]; @@ -540,7 +540,7 @@ sigma_gfx200(sigma_t *sigma) uint8_t plane[4]; uint8_t col; - for (uint8_t x = 0; x < (sigma->crtc[1] << 1); x++) { + for (uint32_t x = 0; x < (sigma->crtc[1] << 1); x++) { plane[0] = vram[x]; plane[1] = vram[0x8000 + x]; plane[2] = vram[0x10000 + x]; @@ -566,7 +566,7 @@ sigma_gfx4col(sigma_t *sigma) uint8_t mask; uint8_t col; - for (uint8_t x = 0; x < (sigma->crtc[1] << 1); x++) { + for (uint32_t x = 0; x < (sigma->crtc[1] << 1); x++) { plane[0] = vram[x]; plane[1] = vram[0x8000 + x]; plane[2] = vram[0x10000 + x];