[sbix] Limit glyph extents

Fixes https://github.com/harfbuzz/harfbuzz/issues/3557
This commit is contained in:
Behdad Esfahbod 2022-06-01 07:38:21 -06:00
parent cd05d187c8
commit 62e803b361
2 changed files with 6 additions and 0 deletions

View File

@ -298,6 +298,12 @@ struct sbix
const PNGHeader &png = *blob->as<PNGHeader>(); const PNGHeader &png = *blob->as<PNGHeader>();
if (png.IHDR.height >= 65536 | png.IHDR.width >= 65536)
{
hb_blob_destroy (blob);
return false;
}
extents->x_bearing = x_offset; extents->x_bearing = x_offset;
extents->y_bearing = png.IHDR.height + y_offset; extents->y_bearing = png.IHDR.height + y_offset;
extents->width = png.IHDR.width; extents->width = png.IHDR.width;

Binary file not shown.