Skip to content

Commit

Permalink
msResampleGDALToMap(): restrict full size acquisition in weird reproj…
Browse files Browse the repository at this point in the history
…ection cases to raster of 'modest' size (#5402)
  • Loading branch information
rouault committed Mar 5, 2017
1 parent 3d9f71a commit bd9ff63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mapresample.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,8 +1499,12 @@ int msResampleGDALToMap( mapObj *map, layerObj *layer, imageObj *image,
/* Check first that the requested extent is not well beyond than the source */
/* raster. This might be the case for example if asking to visualize */
/* -180,-89,180,90 in EPSG:4326 from a raster in Arctic Polar Stereographic */
/* But restrict that to rasters of modest size, otherwise we may end up */
/* requesting very large dimensions in other legit reprojection cases */
/* See https://github.com/mapserver/mapserver/issues/5402 */
if( !(sOrigSrcExtent.minx <= -4 * nSrcXSize && sOrigSrcExtent.miny <= -4 * nSrcYSize &&
sOrigSrcExtent.maxx >= 5 * nSrcXSize && sOrigSrcExtent.maxy >= 5 * nSrcYSize)
sOrigSrcExtent.maxx >= 5 * nSrcXSize && sOrigSrcExtent.maxy >= 5 * nSrcYSize &&
nSrcXSize < 4000 && nSrcYSize < 4000)
&& (sOrigSrcExtent.maxx - sOrigSrcExtent.minx) > dfOversampleRatio * nDstXSize
&& !CSLFetchBoolean( layer->processing, "LOAD_FULL_RES_IMAGE", FALSE ))
sDummyMap.cellsize =
Expand Down

0 comments on commit bd9ff63

Please sign in to comment.