Blame SOURCES/freetype-2.4.11-pcf-read-b.patch

43e195
From 06842c7b49c21f13c0ab61201daab6ff5a358fcc Mon Sep 17 00:00:00 2001
43e195
From: Werner Lemberg <wl@gnu.org>
43e195
Date: Sat, 13 Dec 2014 07:42:51 +0100
43e195
Subject: [PATCH] * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from
43e195
 2014-12-08.
43e195
43e195
---
43e195
 ChangeLog         | 4 ++++
43e195
 src/pcf/pcfread.c | 7 ++++---
43e195
 2 files changed, 8 insertions(+), 3 deletions(-)
43e195
43e195
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
43e195
index e3caf82..a29a9e3 100644
43e195
--- a/src/pcf/pcfread.c
43e195
+++ b/src/pcf/pcfread.c
43e195
@@ -189,14 +189,15 @@ THE SOFTWARE.
43e195
       tables++;
43e195
     }
43e195
 
43e195
-    /* no check of `tables->size' for last table element ... */
43e195
+    /* only check `tables->offset' for last table element ... */
43e195
     if ( ( tables->offset > size ) )
43e195
     {
43e195
       error = PCF_Err_Invalid_Table;
43e195
       goto Exit;
43e195
     }
43e195
-    /* ... instead, we adjust `tables->size' to the real value */
43e195
-    tables->size = size - tables->offset;
43e195
+    /* ... and adjust `tables->size' to the real value if necessary */
43e195
+    if ( tables->size > size - tables->offset )
43e195
+      tables->size = size - tables->offset;
43e195
 
43e195
 #ifdef FT_DEBUG_LEVEL_TRACE
43e195
 
43e195
-- 
43e195
2.1.0
43e195