commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1441115 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
Date Thu, 31 Jan 2013 18:45:43 GMT
Author: damjan
Date: Thu Jan 31 18:45:43 2013
New Revision: 1441115

URL: http://svn.apache.org/viewvc?rev=1441115&view=rev
Log:
Fix an incorrect TIFF field deletion bug (found by Findbugs).


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java?rev=1441115&r1=1441114&r2=1441115&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
Thu Jan 31 18:45:43 2013
@@ -258,7 +258,8 @@ public class TiffReader extends BinaryFi
                 };
                 for (int i = 0; i < offsetFields.length; i++) {
                     final TagInfoLong offsetField = offsetFields[i];
-                    if (directory.findField(offsetField) != null) {
+                    TiffField field = directory.findField(offsetField);
+                    if (field != null) {
                         int subDirectoryOffset;
                         int subDirectoryType;
                         boolean subDirectoryRead = false;
@@ -275,7 +276,7 @@ public class TiffReader extends BinaryFi
                             }
                         }
                         if (!subDirectoryRead) {
-                            fields.remove(offsetField);
+                            fields.remove(field);
                         }
                     }
                 }



Mime
View raw message