msResampleGDALToMap causes memory allocation error #5402

Closed
szekerest opened this Issue Mar 5, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@szekerest
Member

szekerest commented Mar 5, 2017

Since this commit was added e0a3448 mapserver may cause memory allocation errors for certain rasters. Attached a sample map and a vrt file (couldn't attach the source ecw it is 700MB in size).
We can use shp2img to reproduce this as follows:

E:\Maps\DMS>shp2img -m ecwtest_vrt.map -o ecwtest_vrt.png
msDrawMap(): Image handling error. Failed to draw layer named 'test'.

msImageCreate(): Memory allocation error. Unable to create new image object.

agg2CreateImage(): Memory allocation error. ..\mapagg.cpp: 824: Out of memory allocating 10240256000 bytes.

test.zip

rouault added a commit that referenced this issue Mar 5, 2017

@rouault rouault closed this Mar 5, 2017

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 5, 2017

Member

I'm afraid this fix doesn't solve the the issue, if we increase the zoom level, for example by changing the EXTENT in the mapfile to:

EXTENT 13523244.2497627 -3808739.10513869 13650837.2685289 -3716866.07739124

In my particular use case the user might want to zoom out to arbitrary levels which was possible before the referred commit was added.

Member

szekerest commented Mar 5, 2017

I'm afraid this fix doesn't solve the the issue, if we increase the zoom level, for example by changing the EXTENT in the mapfile to:

EXTENT 13523244.2497627 -3808739.10513869 13650837.2685289 -3716866.07739124

In my particular use case the user might want to zoom out to arbitrary levels which was possible before the referred commit was added.

@szekerest szekerest reopened this Mar 5, 2017

rouault added a commit that referenced this issue Mar 5, 2017

msResampleGDALToMap(): restrict full size acquisition in weird reproj…
…ection cases to raster of 'modest' size (#5402)
@rouault

This comment has been minimized.

Show comment
Hide comment
@rouault

rouault Mar 5, 2017

Contributor

OK, I've pushed another restriction that will definitely avoid the regression you saw with rasters of large dimensions

Contributor

rouault commented Mar 5, 2017

OK, I've pushed another restriction that will definitely avoid the regression you saw with rasters of large dimensions

@rouault rouault closed this Mar 5, 2017

dmsadmin pushed a commit to DMS-Aus/MapServer that referenced this issue Mar 15, 2017

dmsadmin pushed a commit to DMS-Aus/MapServer that referenced this issue Mar 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment