From b76dc03108d04975335dbf3580f8d02321cb5d25 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 28 Oct 2018 15:36:17 -0700 Subject: [PATCH] [sbix] Reduce code --- src/hb-ot-color-sbix-table.hh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index 49320785c..d3b737792 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -97,7 +97,8 @@ struct SBIXStrike imageOffsetsZ[glyph_id + 1] - imageOffsetsZ[glyph_id] <= SBIXGlyph::min_size)) return hb_blob_get_empty (); - if (strike_offset + (unsigned int) imageOffsetsZ[glyph_id] + SBIXGlyph::min_size > sbix_len) + unsigned int glyph_offset = strike_offset + (unsigned int) imageOffsetsZ[glyph_id] + SBIXGlyph::min_size; + if (glyph_offset > sbix_len) return hb_blob_get_empty (); const SBIXGlyph *glyph = &(this+imageOffsetsZ[glyph_id]); @@ -121,9 +122,7 @@ struct SBIXStrike if (x_offset) *x_offset = glyph->xOffset; if (y_offset) *y_offset = glyph->yOffset; - unsigned int offset = strike_offset + SBIXGlyph::min_size; - offset += imageOffsetsZ[glyph_id]; - return hb_blob_create_sub_blob (sbix_blob, offset, blob_size); + return hb_blob_create_sub_blob (sbix_blob, glyph_offset, blob_size); } protected: