GeoTools

GeoTiffReader causes NullException when numOverviews == 1

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.4.4
  • Fix Version/s: 2.4.5
  • Component/s: geotiff
  • Labels:
    None
  • Environment:
    RHEL 3, Java 1.5.0_12, JBoss 4.0.3SP1, GeoServer 1.6.4
  • Testcase included:
    yes

Description

GeoTools does not support GeoTiffs that have only one overview. Details below:

On line 308 of GeoTiffReader.java from 2.4.4 tag the overViewResolutions array only gets initialized if numOverviews > 1.
Later on, on line 275 of AbstractGridCoverage2DReader.java (which is base class of GeoTiffReader), overViewResolutions gets dereferenced if numOverviews > 0. In the case where the GeoTiff has exactly one overview, a null exception is thrown.

The fix is to change GeoTiffReader.java:308 to check if numOverviews >= 1.

Issue Links

Activity

Hide
Ryan Hofschneider added a comment -
A GeoTiff with one overview that results in NullPointerException.
Show
Ryan Hofschneider added a comment - A GeoTiff with one overview that results in NullPointerException.
Hide
Daniele Romagnoli added a comment -
The bug has been fixed on trunk 2 months ago (revision 30432).
I will backport the fix to 2.4.x.
Show
Daniele Romagnoli added a comment - The bug has been fixed on trunk 2 months ago (revision 30432). I will backport the fix to 2.4.x.
Hide
Daniele Romagnoli added a comment -
I have fixed the bug and I have tested the plugin with your data sample.
Now it works fine
Show
Daniele Romagnoli added a comment - I have fixed the bug and I have tested the plugin with your data sample. Now it works fine

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: