[util] In --debug mode, duplicate font data
This has the effect that the font data will end up in a memory section malloc()ed exactly to its size. This gives us better valgrind detection of out-of-bounds access. Previously, the font data was placed in a mmap()ed section or GString-allocated area, which didn't have proper protections at the end when running under valgrind.
This commit is contained in:
parent
ed2024ef93
commit
642135f3b2
|
@ -538,6 +538,9 @@ font_options_t::get_font (void) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
mm = HB_MEMORY_MODE_DUPLICATE;
|
||||||
|
|
||||||
blob = hb_blob_create (font_data, len, mm, user_data, destroy);
|
blob = hb_blob_create (font_data, len, mm, user_data, destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue