freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 85167dbd5: [woff2] Remove sfnt size guess check


From: Werner Lemberg
Subject: [freetype2] master 85167dbd5: [woff2] Remove sfnt size guess check
Date: Fri, 14 Jul 2023 12:04:31 -0400 (EDT)

branch: master
commit 85167dbd508c95cc923d36c0be8a602991c6e43a
Author: Ben Wagner <bungeman@chromium.org>
Commit: Ben Wagner <bungeman@chromium.org>

    [woff2] Remove sfnt size guess check
    
    In WOFF the `totalSfntSize` must be correct, however in WOFF2 this value
    is now just a hint and a conforming implementation must not reject
    otherwise valid data if the `totalSfntSize` turns out not to be exact.
    
    * src/sfnt/sfwoff2.c (woff2_open_font): remove check that uncompressed
    woff2 data would fit in the sfnt size guess.
    
    Fixes: #1235
---
 src/sfnt/sfwoff2.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index 49ad5cc81..fecae276c 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -2257,13 +2257,6 @@
       goto Exit;
     }
 
-    if ( woff2.uncompressed_size > sfnt_size )
-    {
-      FT_ERROR(( "woff2_open_font: SFNT table lengths are too large.\n" ));
-      error = FT_THROW( Invalid_Table );
-      goto Exit;
-    }
-
     /* Allocate memory for uncompressed table data. */
     if ( FT_QALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
          FT_FRAME_ENTER( woff2.totalCompressedSize )            )



reply via email to

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