text-freetype2: Fix undefined behavior for alpha > 127

Found via UBSan, actual (sample) error:
"plugins/text-freetype2/text-functionality.c:284:26: runtime error: left
shift of 194 by 24 places cannot be represented in type 'int'"
master
Palana 2015-05-31 04:25:36 +02:00
parent 41c32fd6b6
commit 78ad3ec132
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
for (uint32_t x = 0; x < g_w; x++) {
alpha = slot->bitmap.buffer[glyph_pos];
srcdata->texbuf[buf_pos] =
0x00FFFFFF ^ (alpha << 24);
0x00FFFFFF ^ ((uint32_t)alpha << 24);
}
}