From 35fa3d326096639a33635e19f204a9cb31f20826 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 29 Oct 2018 00:07:26 +0330 Subject: [PATCH] [ot-color] Apply Behdad comment --- src/hb-ot-color-sbix-table.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index 79c86ed01..5e49d7b2a 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -215,12 +215,13 @@ struct sbix hb_blob_t *blob = reference_blob_for_glyph (glyph, x_ppem, y_ppem, HB_TAG ('p','n','g',' '), &x_offset, &y_offset); - if (hb_blob_get_length (blob) < sizeof (PNGHeader)) + + const PNGHeader &header = *blob->as(); + if (header.width == 0 && header.width == 0) return false; extents->x_bearing = x_offset; extents->y_bearing = y_offset; - const PNGHeader &header = *blob->as(); extents->width = header.width; extents->height = header.height; hb_blob_destroy (blob);