rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.65k stars 266 forks source link

Fix buffer over-read and performance bug #164

Closed yairchu closed 7 years ago

yairchu commented 7 years ago

In text_buffer_add_text, for each code-point utf8_strlen is called, causing quadratic performance instead of linear, as well as a memory read outside the buffer for strings that are provided with an explicit length instead of null termination. The fix is simply to use the provided (or previously calculated) length.

rougier commented 7 years ago

Thanks (and sorry for the delay in answering) !