Skip to content

Commit

Permalink
jp2openjpeg.py: avoid potential memory issue with old openjpeg versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Sep 26, 2019
1 parent 9f1c8b8 commit 86a6532
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions autotest/gdrivers/jp2openjpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3109,6 +3109,18 @@ def test_jp2openjpeg_odd_dimensions():

assert cs == 29642

###############################################################################


def test_jp2openjpeg_odd_dimensions_overviews():

if gdaltest.jp2openjpeg_drv is None:
pytest.skip()

# Only try the rest with openjpeg >= 2.3 to avoid potential memory issues
if gdaltest.jp2openjpeg_drv.GetMetadataItem('DMD_CREATIONOPTIONLIST').find('CODEBLOCK_STYLE') < 0:
pytest.skip()

# Check that we don't request outside of the full resolution coordinates
ds = gdal.Open('data/single_block_32769_16385.jp2')
assert ds.ReadRaster(0,0,ds.RasterXSize,ds.RasterYSize,2049,1025)
Expand Down

0 comments on commit 86a6532

Please sign in to comment.