From 3c0a84fd754d2a0b981ea1f0d06ae3046d36da4d Mon Sep 17 00:00:00 2001 From: Simon Pepping Date: Thu, 21 Dec 2006 19:48:13 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/fonts/truetype/FontFileReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.5