[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:
Behdad EsfahbodandClaude Opus 5.5 committed 2026-10-19 15:40:59 -06:00
1 parent f428eaef29
commit b3b84fa571
1 file changed
+1 -1
+1 -1
View File
@@ -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;