Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > d8a71aa3ee3703779bb44ff6a259ff60 > files > 2

freetype2-2.5.4-2.3.mga5.src.rpm

From 06842c7b49c21f13c0ab61201daab6ff5a358fcc Mon Sep 17 00:00:00 2001
From: Werner Lemberg <wl@gnu.org>
Date: Sat, 13 Dec 2014 07:42:51 +0100
Subject: [PATCH 16/16] * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from
 2014-12-08.

--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -192,14 +192,15 @@ THE SOFTWARE.
       tables++;
     }
 
-    /* no check of `tables->size' for last table element ... */
+    /* only check `tables->offset' for last table element ... */
     if ( ( tables->offset > size ) )
     {
       error = FT_THROW( Invalid_Table );
       goto Exit;
     }
-    /* ... instead, we adjust `tables->size' to the real value */
-    tables->size = size - tables->offset;
+    /* ... and adjust `tables->size' to the real value if necessary */
+    if ( tables->size > size - tables->offset )
+      tables->size = size - tables->offset;
 
 #ifdef FT_DEBUG_LEVEL_TRACE
 
-- 
2.2.0