* src/sfnt/sfwoff2.c (reconstruct_glyf): Revise variables.

This should fix #1379 while resonstructing the code intent.
This commit is contained in:
Alexei Podtelezhnikov 2026-01-27 19:41:17 -05:00
parent 7cc8f37b9a
commit 28407bc8cd

View file

@ -1043,7 +1043,6 @@
FT_ULong total_n_points = 0;
FT_UShort n_points_contour;
FT_UInt j;
FT_ULong flag_size;
FT_ULong triplet_size;
FT_ULong triplet_bytes_used;
FT_Bool have_overlap = FALSE;
@ -1088,8 +1087,8 @@
}
substreams[N_POINTS_STREAM].offset = FT_STREAM_POS();
flag_size = total_n_points;
if ( flag_size > substreams[FLAG_STREAM].size )
points_size += total_n_points;
if ( points_size > substreams[FLAG_STREAM].size )
goto Fail;
flags_buf = stream->base + substreams[FLAG_STREAM].offset;
@ -1106,8 +1105,7 @@
triplet_bytes_used = 0;
/* Create array to store point information. */
points_size = total_n_points;
if ( FT_QNEW_ARRAY( points, points_size ) )
if ( FT_QNEW_ARRAY( points, total_n_points ) )
goto Fail;
if ( triplet_decode( flags_buf,
@ -1118,7 +1116,7 @@
&triplet_bytes_used ) )
goto Fail;
substreams[FLAG_STREAM].offset += flag_size;
substreams[FLAG_STREAM].offset += total_n_points;
substreams[GLYPH_STREAM].offset += triplet_bytes_used;
if ( FT_STREAM_SEEK( substreams[GLYPH_STREAM].offset ) ||