freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 38ecc94: Another fix for handling invalid format 2 cm


From: Werner LEMBERG
Subject: [freetype2] master 38ecc94: Another fix for handling invalid format 2 cmaps.
Date: Sun, 22 Apr 2018 04:14:32 -0400 (EDT)

branch: master
commit 38ecc949ce1bfe4ceb567df7d8c7daf1d620fd3a
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Another fix for handling invalid format 2 cmaps.
    
    The previous commit was incomplete.
    
    Reported as
    
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928
    
    * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid
    an endless loop.
---
 ChangeLog         | 15 ++++++++++++++-
 src/sfnt/ttcmap.c |  2 +-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 57c617e..4dc8c55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-04-22  Werner Lemberg  <address@hidden>
+
+       Another fix for handling invalid format 2 cmaps.
+
+       The previous commit was incomplete.
+
+       Reported as
+
+         https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928
+
+       * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid
+       an endless loop.
+
 2018-04-19  Werner Lemberg  <address@hidden
 
        [autofit] Add support for Georgian Mtavruli characters.
@@ -9,7 +22,7 @@
 
        * src/autofit/afscript.h: Add Mtavruli standard character.
 
-2018-03-13  Werner Lemberg  <address@hidden>
+2018-04-18  Werner Lemberg  <address@hidden>
 
        Fix handling of invalid format 2 cmaps.
 
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 71a3c1e..07075cb 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -518,7 +518,7 @@
         FT_UInt   pos, idx;
 
 
-        if ( char_lo > start + count )
+        if ( char_lo > start + count && charcode <= 0xFF )
         {
           /* this happens only for a malformed cmap */
           charcode = 0x100;



reply via email to

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