aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sfnt.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/sfnt.c b/src/sfnt.c
index 7ef56a47469..b803ada8955 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -2672,9 +2672,6 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph,
2672 if (recursion_count > 16) 2672 if (recursion_count > 16)
2673 return 1; 2673 return 1;
2674 2674
2675 /* Don't defer offsets. */
2676 defer_offsets = false;
2677
2678 for (j = 0; j < glyph->compound->num_components; ++j) 2675 for (j = 0; j < glyph->compound->num_components; ++j)
2679 { 2676 {
2680 /* Look up the associated subglyph. */ 2677 /* Look up the associated subglyph. */
@@ -2685,6 +2682,12 @@ sfnt_decompose_compound_glyph (struct sfnt_glyph *glyph,
2685 if (!subglyph) 2682 if (!subglyph)
2686 return 1; 2683 return 1;
2687 2684
2685 /* Don't defer offsets. This variable is set if the component
2686 glyph is a compound glyph that is anchored to a previously
2687 decomposed point, and needs its coordinates adjusted after
2688 decomposition completes. */
2689 defer_offsets = false;
2690
2688 /* Record the size of the point array before expansion. This 2691 /* Record the size of the point array before expansion. This
2689 will be the base to apply to all points coming from this 2692 will be the base to apply to all points coming from this
2690 subglyph. */ 2693 subglyph. */
@@ -2922,8 +2925,8 @@ static void
2922sfnt_lerp_half (struct sfnt_point *control1, struct sfnt_point *control2, 2925sfnt_lerp_half (struct sfnt_point *control1, struct sfnt_point *control2,
2923 struct sfnt_point *result) 2926 struct sfnt_point *result)
2924{ 2927{
2925 result->x = control1->x + ((control2->x - control1->x) >> 1); 2928 result->x = control1->x + ((control2->x - control1->x) / 2);
2926 result->y = control1->y + ((control2->y - control1->y) >> 1); 2929 result->y = control1->y + ((control2->y - control1->y) / 2);
2927} 2930}
2928 2931
2929/* Decompose contour data inside X, Y and FLAGS, between the indices 2932/* Decompose contour data inside X, Y and FLAGS, between the indices
@@ -11624,9 +11627,6 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
11624 if (recursion_count > 16) 11627 if (recursion_count > 16)
11625 return "Overly deep recursion in compound glyph data"; 11628 return "Overly deep recursion in compound glyph data";
11626 11629
11627 /* Don't defer offsets. */
11628 defer_offsets = false;
11629
11630 /* Pacify -Wmaybe-uninitialized. */ 11630 /* Pacify -Wmaybe-uninitialized. */
11631 point = point2 = 0; 11631 point = point2 = 0;
11632 11632
@@ -11640,6 +11640,12 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
11640 if (!subglyph) 11640 if (!subglyph)
11641 return "Failed to obtain component glyph"; 11641 return "Failed to obtain component glyph";
11642 11642
11643 /* Don't defer offsets. This variable is set if the component
11644 glyph is a compound glyph that is anchored to a previously
11645 decomposed point, and needs its coordinates adjusted after
11646 decomposition completes. */
11647 defer_offsets = false;
11648
11643 /* Record the size of the point array before expansion. This 11649 /* Record the size of the point array before expansion. This
11644 will be the base to apply to all points coming from this 11650 will be the base to apply to all points coming from this
11645 subglyph. */ 11651 subglyph. */
@@ -13783,7 +13789,7 @@ sfnt_compute_tuple_scale (struct sfnt_blend *blend, bool intermediate_p,
13783 sfnt_f2dot14 *intermediate_end) 13789 sfnt_f2dot14 *intermediate_end)
13784{ 13790{
13785 int i; 13791 int i;
13786 sfnt_fixed coord, start, end; 13792 sfnt_fixed coord, start UNINIT, end UNINIT;
13787 sfnt_fixed scale; 13793 sfnt_fixed scale;
13788 13794
13789 /* scale is initially 1.0. */ 13795 /* scale is initially 1.0. */
@@ -13794,6 +13800,9 @@ sfnt_compute_tuple_scale (struct sfnt_blend *blend, bool intermediate_p,
13794 /* Load values for this axis, scaled up to sfnt_fixed. */ 13800 /* Load values for this axis, scaled up to sfnt_fixed. */
13795 coord = coords[i] * 4; 13801 coord = coords[i] * 4;
13796 13802
13803 /* GCC warns about start and end being used when uninitialized,
13804 but they are used only if intermediate_p. */
13805
13797 if (intermediate_p) 13806 if (intermediate_p)
13798 { 13807 {
13799 start = intermediate_start[i] * 4; 13808 start = intermediate_start[i] * 4;