From: Simon Pepping Date: Thu, 21 Dec 2006 19:54:40 +0000 (+0000) Subject: Avoid reading beyond the end of the file. This fixes bug 41117. X-Git-Tag: fop-0_93~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=978ef8c99be2cb0eeb9a772bec427b0d5041cd21;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/branches/fop-0_93@489450 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); }