Zoomed in small bbox causes java.lang.ArithmeticException: / by zero

Description

Note that this issue did not occur in geotools 17.

See the attachment for the layer.

Request:
/wms?service=WMS&version=1.1.0&request=GetMap&layers=cite:be_b_c&styles=&bbox=244897.2157599071,202588.4763366661,244897.2203125144,202588.4808892734&width=200&height=200&srs=EPSG:31370&format=image%2Fpng

Exception:

Caused by: java.lang.ArithmeticException: / by zero
at com.sun.media.jai.util.Rational.ceil(Rational.java:242)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRendererUtilities.layoutHelper(GridCoverageRendererUtilities.java:269)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.affine(GridCoverageRenderer.java:646)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.symbolize(GridCoverageRenderer.java:469)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:979)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:804)
at org.geoserver.wms.map.RenderedImageMapOutputFormat.directRasterRender(RenderedImageMapOutputFormat.java:1015)
... 115 more

Environment

None

Status

Assignee

Daniele Romagnoli

Reporter

Niels Charlier

Triage

None

Components

Fix versions

Affects versions

18.2
21.2
20.5

Priority

Medium