mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
4677b72a4c
When consuming text from an io.Reader, the shaper could hit an EOF when reading the text, then still try to check whether it was done by calling ReadByte() followed by UnreadByte(). The ReadByte() would still return EOF, but the UnreadByte() would then walk the iterator cursor backwards to the final byte of the text. If and only if the text was being truncated, this unexpected cursor position could cause the shaper to conclude that there were additional runes that were truncated, and thus the returned glyph stream would account for too many runes. This commit provides a test and a fix. Many thanks to Jack Mordaunt for the excellent bug report leading to this fix. Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>