From dd83db2e23062642ab964bad226146a8bdac1349 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 14 Jan 2024 21:06:10 +0800 Subject: [PATCH] Correct implementations of FLIPRGON and FLIPRGOFF * src/sfnt.c (sfnt_interpret_fliprgoff) (sfnt_interpret_fliprgon): Reorder arguments to match the order in which arguments are popped by macro wrappers. Fix sundry typos. --- src/sfnt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sfnt.c b/src/sfnt.c index f4c023f35c6..2f0153b9a75 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -8966,7 +8966,7 @@ sfnt_dual_project_vector (struct sfnt_interpreter *interpreter, static void sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, - uint32_t l, uint32_t h) + uint32_t h, uint32_t l) { uint32_t i; @@ -8976,7 +8976,7 @@ sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, if (!interpreter->state.zp0) return; - for (i = l; i < h; ++i) + for (i = l; i <= h; ++i) interpreter->glyph_zone->flags[i] &= ~01; } @@ -8985,7 +8985,7 @@ sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, static void sfnt_interpret_fliprgon (struct sfnt_interpreter *interpreter, - uint32_t l, uint32_t h) + uint32_t h, uint32_t l) { uint32_t i; @@ -8995,8 +8995,8 @@ sfnt_interpret_fliprgon (struct sfnt_interpreter *interpreter, if (!interpreter->state.zp0) return; - for (i = l; i < h; ++i) - interpreter->glyph_zone->flags[i] |= ~01; + for (i = l; i <= h; ++i) + interpreter->glyph_zone->flags[i] |= 01; } /* Interpret a FLIPPT instruction in INTERPRETER. For loop times, pop -- 2.39.2