freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master c37a501 2/2: * src/sfnt/sfwoff2.c (woff2_open_font):


From: Werner LEMBERG
Subject: [freetype2] master c37a501 2/2: * src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check.
Date: Sat, 28 Sep 2019 01:43:41 -0400 (EDT)

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

    * src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check.
    
    Correct thinkos in patch from 2019-09-01.
---
 ChangeLog          |  6 ++++++
 src/sfnt/sfwoff2.c | 11 +++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc3163f..1904cda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2019-09-28  Werner Lemberg  <address@hidden>
 
+       * src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check.
+
+       Correct thinkos in patch from 2019-09-01.
+
+2019-09-28  Werner Lemberg  <address@hidden>
+
        [woff2] Fix memory leaks.
 
        One of them reported as
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index b88d13d..daa9a7c 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -2107,8 +2107,8 @@
       /* However, adjust the value to something reasonable. */
 
       /* Factor 64 is heuristic. */
-      if ( ( woff2.totalSfntSize >> 6 ) > sfnt_size )
-        sfnt_size <<= 6;
+      if ( ( woff2.totalSfntSize >> 6 ) > woff2.length )
+        sfnt_size = woff2.length << 6;
       else
         sfnt_size = woff2.totalSfntSize;
 
@@ -2116,8 +2116,11 @@
       if (sfnt_size >= (1 << 26))
         sfnt_size = 1 << 26;
 
-      FT_TRACE4(( "adjusting estimate of uncompressed font size to %lu\n",
-                  sfnt_size ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+      if ( sfnt_size != woff2.totalSfntSize )
+        FT_TRACE4(( "adjusting estimate of uncompressed font size to %lu\n",
+                    sfnt_size ));
+#endif
     }
 
     /* Write sfnt header. */



reply via email to

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