vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: e87c83d5e54f4a762d738a2485a674b10ae26840
Parent: 44c66d713476841767a1ea3ab1804160535651a7
Author: Randy Palamar
Date:   Tue, 27 Aug 2024 22:58:21 -0600

font.c: fix 1 UB

apparently FreeType's bitmap buffer is signed char so we can't
shift 24 without explicitly casting to an unsigned type first.

Diffstat:
Mfont.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/font.c b/font.c @@ -203,7 +203,7 @@ render_glyph(FontAtlas *fa, u32 cp, Glyph *out_glyph, u32 *out_idx) u32 pixel = 0; if (0 /* COLOURED */) { } else { - pixel = gs->bitmap.buffer[i * cg->g.size.w + j] << 24; + pixel = (u32)(gs->bitmap.buffer[i * cg->g.size.w + j]) << 24; } rgba_bitmap[i * cg->g.size.w + j] = pixel; }