References #3055 for PostGIS 2.4.4,
also minor doc fix references #2925 for PostGIS 2.4.4
git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@16504
b70326c6-7e19-0410-871a-
916f4a2858ee
PostGIS 2.4.4dev
-2018/MM/DD
+2018/04/DD
* Bug fixes *
+ - #3055, [raster] ST_Clip() on a raster without band crashes the server
+ (Regina Obe)
- #3942, geojson: Do not include private header for json-c >= 0.13
(Björn Esser)
- #3952, ST_Transform fails in parallel mode (Paul Ramsey)
</informalfigure></para>
<programlisting>
-- this will output a black circle taking up 150 x 150 pixels --
-SELECT ST_AsPNG(ST_AsRaster(ST_Buffer(ST_Point(1,5),10),150, 150, '2BUI'));</programlisting>
+SELECT ST_AsPNG(ST_AsRaster(ST_Buffer(ST_Point(1,5),10),150, 150));</programlisting>
<para><informalfigure>
<mediaobject>
}
/* raster is empty, return empty raster */
- if (rt_raster_is_empty(arg->raster)) {
- elog(NOTICE, "Input raster is empty. Returning empty raster");
+ if (rt_raster_is_empty(arg->raster) || rt_raster_get_num_bands(arg->raster) == 0) {
+ elog(NOTICE, "Input raster is empty or has no bands. Returning empty raster");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
DROP TABLE IF EXISTS test_raster_scale_small;
SET client_min_messages TO DEFAULT;
+
+/******************************************************************************
+ #3055 ST_Clip() on a raster without band crashes the server
+******************************************************************************/
+SELECT ST_SummaryStats(ST_Clip(ST_MakeEmptyRaster(42, 42, 0, 0, 1.0, 1.0, 0, 0, 4269), ST_MakeEnvelope(0, 0, 20, 20, 4269)));
t
test_raster_scale_small|rast||1
ERROR: new row for relation "test_raster_scale_small" violates check constraint "enforce_scaley_rast"
+NOTICE: Input raster is empty or has no bands. Returning empty raster
+NOTICE: Invalid band index (must use 1-based). Returning NULL