mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 00:59:16 +01:00
[wasm] Fix contours allocation check in font_copy_glyph_outline
The check meant to catch a failed contours allocation tested !n_contours instead of n_contours. An allocation failure went unnoticed, leaving the guest with n_contours > 0 and a null contours array; the check was otherwise unreachable on success since points are always accompanied by contours. Tested: meson test passes on a -Dwasm=enabled build; a wasm module copying a glyph outline through the allocating path still succeeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f428eaef29
commit
b3b84fa571
1 file changed
+1
-1
@@ -179,7 +179,7 @@ HB_WASM_API (bool_t, font_copy_glyph_outline) (HB_WASM_EXEC_ENV
|
||||
hb_outline.contours.get_size ());
|
||||
|
||||
if ((outline->n_points && !outline->points) ||
|
||||
(!outline->n_contours && !outline->contours))
|
||||
(outline->n_contours && !outline->contours))
|
||||
{
|
||||
outline->n_points = outline->n_contours = 0;
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user