freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master c6c2c0b 11/27: [woff2] Minor.


From: Werner LEMBERG
Subject: [freetype2] master c6c2c0b 11/27: [woff2] Minor.
Date: Tue, 27 Aug 2019 04:45:47 -0400 (EDT)

branch: master
commit c6c2c0b574c6a8b6f0a780516f96b1a98af8492e
Author: Nikhil Ramakrishnan <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [woff2] Minor.
    
    * src/sfnt/sfwoff2.c (woff2_uncompress): Add error message
    (woff2_open_font): Free `uncompressed_buf'.
---
 ChangeLog          | 7 +++++++
 src/sfnt/sfwoff2.c | 7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3afc343..f89194b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2019-08-27  Nikhil Ramakrishnan  <address@hidden>
 
+       [woff2] Minor.
+
+       * src/sfnt/sfwoff2.c (woff2_uncompress): Add error message
+       (woff2_open_font): Free `uncompressed_buf'.
+
+2019-08-27  Nikhil Ramakrishnan  <address@hidden>
+
        [woff2] Uncompress Brotli streams and `face_index' support.
 
        WOFF2 compressed stream is now uncompressed if Brotli is available.
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index ec30602..614c99b 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -219,7 +219,10 @@
 
     if( result != BROTLI_DECODER_RESULT_SUCCESS ||
         uncompressed_size != dst_size )
+      {
+        FT_ERROR(( "woff2_uncompress: Stream length mismatch.\n" ));
         return FT_THROW( Invalid_Table );
+      }
 
     return FT_Err_Ok;
 
@@ -498,7 +501,6 @@
       }
       /* Collection directory reading complete. */
       FT_TRACE2(( "WOFF2 collection dirtectory is valid.\n" ));
-
     }
 
     first_table_offset = compute_first_table_offset( &woff2 );
@@ -506,7 +508,7 @@
 
     woff2.compressed_offset = FT_STREAM_POS();
     file_offset = ROUND4( woff2.compressed_offset +
-                            woff2.totalCompressedSize );
+                          woff2.totalCompressedSize );
 
     /* Few more checks before we start reading the tables. */
     if( file_offset > woff2.length )
@@ -619,6 +621,7 @@
   Exit:
     FT_FREE( tables );
     FT_FREE( indices );
+    FT_FREE( uncompressed_buf );
 
     if( error )
     {



reply via email to

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