You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2007/09/20 06:13:16 UTC
svn commit: r577535 -
/xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java
Author: cam
Date: Wed Sep 19 21:13:15 2007
New Revision: 577535
URL: http://svn.apache.org/viewvc?rev=577535&view=rev
Log:
Check for EOF when parsing WMF files. Fixes bug 42255.
Thanks Trejkaz!
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java?rev=577535&r1=577534&r2=577535&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/AbstractWMFReader.java Wed Sep 19 21:13:15 2007
@@ -78,22 +78,24 @@
this.height = height;
}
- /** read the next short ( 2 bytes) value in the DataInputStream.
+ /**
+ * Read the next short (2 bytes) value in the DataInputStream.
*/
- protected short readShort(DataInputStream is ) throws IOException {
+ protected short readShort(DataInputStream is) throws IOException {
byte js[] = new byte[ 2 ];
- is.read( js );
+ is.readFully(js);
int iTemp = ((0xff) & js[ 1 ] ) << 8;
short i = (short)(0xffff & iTemp);
i |= ((0xff) & js[ 0 ] );
return i;
}
- /** read the next int ( 4 bytes) value in the DataInputStream.
+ /**
+ * Read the next int (4 bytes) value in the DataInputStream.
*/
- protected int readInt( DataInputStream is ) throws IOException {
+ protected int readInt( DataInputStream is) throws IOException {
byte js[] = new byte[ 4 ];
- is.read( js );
+ is.readFully(js);
int i = ((0xff) & js[ 3 ] ) << 24;
i |= ((0xff) & js[ 2 ] ) << 16;
i |= ((0xff) & js[ 1 ] ) << 8;