Changeset 5143


Ignore:
Timestamp:
06/01/09 10:00:06 (11 years ago)
Author:
melissa
Message:

Reset lastPlane when close() is called and make sure that lastPlane is valid when retrieving lookup tables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/MinimalTiffReader.java

    r5114 r5143  
    8181  public byte[][] get8BitLookupTable() throws FormatException, IOException { 
    8282    FormatTools.assertId(currentId, true, 1); 
    83     if (ifds == null) return null; 
     83    if (ifds == null || lastPlane < 0 || lastPlane > ifds.length) return null; 
    8484    int[] bits = TiffTools.getBitsPerSample(ifds[lastPlane]); 
    8585    if (bits[0] <= 8) { 
     
    104104  public short[][] get16BitLookupTable() throws FormatException, IOException { 
    105105    FormatTools.assertId(currentId, true, 1); 
    106     if (ifds == null) return null; 
     106    if (ifds == null || lastPlane < 0 || lastPlane > ifds.length) return null; 
    107107    int[] bits = TiffTools.getBitsPerSample(ifds[lastPlane]); 
    108108    if (bits[0] <= 16 && bits[0] > 8) { 
     
    198198    ifds = null; 
    199199    thumbnailIFDs = null; 
     200    lastPlane = 0; 
    200201  } 
    201202 
Note: See TracChangeset for help on using the changeset viewer.