From 865a303517b023cf0d81a49c4614fa01b592510e Mon Sep 17 00:00:00 2001 From: wanghao-free Date: Mon, 13 Mar 2023 01:21:59 -0700 Subject: [PATCH] fix CVE-2022-33068 Description: Limit glyph extents IssueNo: https://gitee.com/openharmony/third_party_harfbuzz/issues/I63NCG Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: wanghao-free --- src/hb-ot-color-sbix-table.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index af1e4a5d..e085ee0d 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -298,6 +298,12 @@ struct sbix const PNGHeader &png = *blob->as(); + if ((png.IHDR.height >= 65536) | (png.IHDR.width >= 65536)) + { + hb_blob_destroy (blob); + return false; + } + extents->x_bearing = x_offset; extents->y_bearing = png.IHDR.height + y_offset; extents->width = png.IHDR.width; -- Gitee