提交 78ad3ec1 编写于 作者: P Palana

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'"
上级 41c32fd6
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册