[poppler] fofi/FoFiTrueType.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Feb 11 08:36:40 PST 2015


 fofi/FoFiTrueType.cc |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit bf4aae25a244b1033a2479b9a8f633224f7d5de5
Author: William Bader <williambader at hotmail.com>
Date:   Wed Feb 11 17:35:40 2015 +0100

    Off by one fix to the previous crash fix

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 6ab8f9b..11699dd 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -22,6 +22,7 @@
 // Copyright (C) 2012 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2014 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2015 Aleksei Volkov <Aleksei Volkov>
+// Copyright (C) 2015 William Bader <williambader at hotmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1222,15 +1223,15 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
 	  dumpString(file + tables[j].offset, tables[j].len,
 		     outputFunc, outputStream);
 	} else if (needVerticalMetrics && i == t42VheaTable) {
-	  if (unlikely(length >= (int)sizeof(vheaTab))) {
+	  if (unlikely(length > (int)sizeof(vheaTab))) {
 	    error(errSyntaxWarning, -1, "length bigger than vheaTab size");
-	    length = sizeof(vheaTab) - 1;
+	    length = sizeof(vheaTab);
 	  }
 	  dumpString(vheaTab, length, outputFunc, outputStream);
 	} else if (needVerticalMetrics && i == t42VmtxTable) {
-	  if (unlikely(length >= vmtxTabLength)) {
+	  if (unlikely(length > vmtxTabLength)) {
 	    error(errSyntaxWarning, -1, "length bigger than vmtxTab size");
-	    length = vmtxTabLength - 1;
+	    length = vmtxTabLength;
 	  }
 	  dumpString(vmtxTab, length, outputFunc, outputStream);
 	}


More information about the poppler mailing list