]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Avoid reading beyond the end of the file. This fixes bug 41117.
authorSimon Pepping <spepping@apache.org>
Thu, 21 Dec 2006 19:48:13 +0000 (19:48 +0000)
committerSimon Pepping <spepping@apache.org>
Thu, 21 Dec 2006 19:48:13 +0000 (19:48 +0000)
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

index 4f906a0060cb0757afdbbf59a853c41e8eced3bf..42049eaac2f1990ed507bb92edf3b13a466d22e0 100644 (file)
@@ -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);
         }