From: Simon Pepping Date: Thu, 21 Dec 2006 19:48:13 +0000 (+0000) Subject: Avoid reading beyond the end of the file. This fixes bug 41117. X-Git-Tag: fop-0_94~273 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c0a84fd754d2a0b981ea1f0d06ae3046d36da4d;p=xmlgraphics-fop.git Avoid reading beyond the end of the file. This fixes bug 41117. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@489448 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java index 4f906a006..42049eaac 100644 --- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java +++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java @@ -82,7 +82,7 @@ public class FontFileReader { * @throws IOException In case of an I/O problem */ public void seekSet(long offset) throws IOException { - if (offset > fsize || offset < 0) { + if (offset >= fsize || offset < 0) { throw new java.io.EOFException("Reached EOF, file size=" + fsize + " offset=" + offset); } @@ -134,7 +134,7 @@ public class FontFileReader { * @throws IOException If EOF is reached */ public byte read() throws IOException { - if (current > fsize) { + if (current >= fsize) { throw new java.io.EOFException("Reached EOF, file size=" + fsize); }