Skip to content
Snippets Groups Projects
Commit 14da36cb authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix GCC UBSan (SANITIZE=1 build) runtime error

left shift of 255 by 24 places cannot be represented in type 'int'
parent b4f9d84b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4512 passed
...@@ -610,7 +610,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne ...@@ -610,7 +610,7 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
} }
else else
fb = 0; fb = 0;
} }
} }
fbb = fb & (0x80 >> (fdx & 7)); fbb = fb & (0x80 >> (fdx & 7));
...@@ -844,10 +844,10 @@ static int update_from_vmem(int force) ...@@ -844,10 +844,10 @@ static int update_from_vmem(int force)
vmem_ptr = get_vmem(&vstat); vmem_ptr = get_vmem(&vstat);
cols = vstat.cols; cols = vstat.cols;
/* /*
* Now we go through each character seeing if it's changed (or force is set) * Now we go through each character seeing if it's changed (or force is set)
* We combine updates into rectangles by lines... * We combine updates into rectangles by lines...
* *
* First, in the same line, we build this_rect. * First, in the same line, we build this_rect.
* At the end of the line, if this_rect is the same width as the screen, * At the end of the line, if this_rect is the same width as the screen,
* we add it to last_rect. * we add it to last_rect.
...@@ -1931,7 +1931,7 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data) ...@@ -1931,7 +1931,7 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data)
vstat.flags = VIDMODES_FLAG_PALETTE_VMEM; vstat.flags = VIDMODES_FLAG_PALETTE_VMEM;
pthread_mutex_lock(&screenlock); pthread_mutex_lock(&screenlock);
for (i = 0; i < sizeof(dac_default)/sizeof(struct dac_colors); i++) { for (i = 0; i < sizeof(dac_default)/sizeof(struct dac_colors); i++) {
palette[i] = (0xff << 24) | (dac_default[i].red << 16) | (dac_default[i].green << 8) | dac_default[i].blue; palette[i] = (0xffU << 24) | (dac_default[i].red << 16) | (dac_default[i].green << 8) | dac_default[i].blue;
} }
pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&screenlock);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment