You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2006/12/21 20:48:14 UTC

svn commit: r489448 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java

Author: spepping
Date: Thu Dec 21 11:48:13 2006
New Revision: 489448

URL: http://svn.apache.org/viewvc?view=rev&rev=489448
Log:
Avoid reading beyond the end of the file. This fixes bug 41117.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java?view=diff&rev=489448&r1=489447&r2=489448
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/FontFileReader.java Thu Dec 21 11:48:13 2006
@@ -82,7 +82,7 @@
      * @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 @@
      * @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);
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org