Segfault when rasterizing a glyph with size=0
LeshaInc opened this issue · 0 comments
LeshaInc commented
To reproduce: in the 'simple' example change the constants to SIZE = 0.0
, CHARACTER = 'o'
, FONT = include_bytes!("path to UbuntuMono-Regular.ttf")
. (You can download "UbuntuMono-Regular.ttf" from Google Fonts, GitHub doesn't allow attaching .ttf files to issues).
Program received signal SIGSEGV, Segmentation fault.
0x000055555558b570 in fontdue::raster::Raster::add (self=0x7fffffffcb00, index=18446744071562067968, height=0, mid_x=0) at src/raster.rs:45
45 *self.a.get_unchecked_mut(index) += height - m;
(gdb) bt
#0 0x000055555558b570 in fontdue::raster::Raster::add (self=0x7fffffffcb00, index=18446744071562067968, height=0, mid_x=0) at src/raster.rs:45
#1 fontdue::raster::Raster::m_line (self=0x7fffffffcb00, line=0x5555558a7710, coords=..., params=...) at src/raster.rs:118
#2 fontdue::raster::Raster::draw (self=0x7fffffffcb00, glyph=0x55555567a430, scale_x=0, scale_y=0, offset_x=0, offset_y=0) at src/raster.rs:36
#3 0x000055555558e457 in fontdue::font::Font::rasterize_indexed (self=0x7fffffffcd08, index=82, px=0) at src/font.rs:525
#4 0x0000555555570fb1 in fontdue::font::Font::rasterize (self=0x7fffffffcd08, character=111 'o', px=0) at /home/leshainc/Projects/fontdue/src/font.rs:462
#5 0x000055555556be7b in simple::generate_fontdue () at examples/simple.rs:28
#6 0x000055555556bdc6 in simple::main () at examples/simple.rs:14