[sfnt] Fix fallout from 2021-05-29 change.

* src/sfnt/ttcolr.c (find_base_glyph_record,
find_base_glyph_v1_record): Adjust binary search.

Needs to be updated with change to unsigned.
This commit is contained in:
Ben Wagner 2021-06-01 15:25:31 -04:00 committed by Werner Lemberg
parent 7ca7da9d13
commit 2a6665a4c0
2 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,13 @@
2021-06-02 Ben Wagner <bungeman@chromium.org>
Werner Lemberg <wl@gnu.org>
[sfnt] Fix fallout from 2021-05-29 change.
* src/sfnt/ttcolr.c (find_base_glyph_record,
find_base_glyph_v1_record): Adjust binary search.
Needs to be updated with change to unsigned.
2021-06-02 Werner Lemberg <wl@gnu.org>
* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix tracing.

View File

@ -233,10 +233,10 @@
BaseGlyphRecord* record )
{
FT_UInt min = 0;
FT_UInt max = num_base_glyph - 1;
FT_UInt max = num_base_glyph;
while ( min <= max )
while ( min < max )
{
FT_UInt mid = min + ( max - min ) / 2;
FT_Byte* p = base_glyph_begin + mid * BASE_GLYPH_SIZE;
@ -247,7 +247,7 @@
if ( gid < glyph_id )
min = mid + 1;
else if (gid > glyph_id )
max = mid - 1;
max = mid;
else
{
record->gid = gid;
@ -590,16 +590,16 @@
static FT_Bool
find_base_glyph_v1_record ( FT_Byte * base_glyph_begin,
FT_UInt num_base_glyph,
FT_UInt glyph_id,
BaseGlyphV1Record *record )
find_base_glyph_v1_record( FT_Byte * base_glyph_begin,
FT_UInt num_base_glyph,
FT_UInt glyph_id,
BaseGlyphV1Record *record )
{
FT_UInt min = 0;
FT_UInt max = num_base_glyph - 1;
FT_UInt max = num_base_glyph;
while ( min <= max )
while ( min < max )
{
FT_UInt mid = min + ( max - min ) / 2;
@ -616,7 +616,7 @@
if ( gid < glyph_id )
min = mid + 1;
else if (gid > glyph_id )
max = mid - 1;
max = mid;
else
{
record->gid = gid;