For some fonts, applying Harfbuzz to a segment might produce an increased number of glyphs than the original number of Unocode codepoints. This might result in memory corruption, as drawing logic will fill the specbuf beyond its capacity.
This patch fixes the problem:
The specbuf is increased to 4 times the line size to accomodate possible string expansion.
The hbtransform is refactored to be able to produce more glyphs than the were codepoints in the original string.
xdrawline is refactored to be able to compose and draw multiple line segments.
Fix for a bug #29.
For some fonts, applying Harfbuzz to a segment might produce an increased number of glyphs than the original number of Unocode codepoints. This might result in memory corruption, as drawing logic will fill the
specbuf
beyond its capacity.This patch fixes the problem:
specbuf
is increased to 4 times the line size to accomodate possible string expansion.hbtransform
is refactored to be able to produce more glyphs than the were codepoints in the original string.xdrawline
is refactored to be able to compose and draw multiple line segments.