emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android 279efc6cc2a: Update Android port


From: Po Lu
Subject: feature/android 279efc6cc2a: Update Android port
Date: Wed, 29 Mar 2023 01:23:45 -0400 (EDT)

branch: feature/android
commit 279efc6cc2ab167eb0c791b3b138d249c49778d7
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Update Android port
    
    * src/sfntfont.c (sfntfont_setup_interpreter): Don't create
    interpreter for blatently broken fonts.
---
 src/sfntfont.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/sfntfont.c b/src/sfntfont.c
index 40272247116..99ba6bb1001 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -2504,6 +2504,15 @@ sfntfont_setup_interpreter (struct sfnt_font_info *info,
   if (!fpgm && !prep)
     goto bail;
 
+  /* If the interpreter does not use the operand stack at all, it is
+     useless.  In addition, some broken fonts specify some unnecessary
+     instructions in prep and set head->max_stack_elements to 0.
+
+     Don't create the interpreter in that case.  */
+
+  if (!info->maxp->max_stack_elements)
+    goto bail;
+
   /* Now, create the interpreter using the limits in info->maxp and
      info->head.  CVT can be NULL.  */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]