From 3bf931b54de05092cd4114bb874ce7761516d51d Mon Sep 17 00:00:00 2001 From: liuyuxiang-bear Date: Fri, 5 Aug 2022 10:54:08 +0800 Subject: [PATCH] fixed 6f6c666 from https://gitee.com/liuyuxiang-bear/third_party_freetype/pulls/28 Description: Vulnerability Remediation IssueNo: https://gitee.com/openharmony/third_party_freetype/issues/I5KDNH Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: liuyuxiang --- src/base/ftobjs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 3cb1d8e..8957738 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -2389,6 +2389,15 @@ #endif + /* only use lower 31 bits together with sign bit */ + if( face_index > 0 ) + face_index &= 0x7FFFFFFFL; + else + { + face_index &= 0x7FFFFFFFL; + face_index = -face_index; + } + #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE3(( "FT_Open_Face: " )); if ( face_index < 0 ) -- Gitee