From: Bborie Park Date: Tue, 5 Mar 2013 16:57:49 +0000 (+0000) Subject: Minor code cleanup in raster2pgsql and additional debug output for X-Git-Tag: 2.1.0beta2~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c0fddcc54c4606b91bf0d7f074a62b70974355c;p=postgis Minor code cleanup in raster2pgsql and additional debug output for rt_api git-svn-id: http://svn.osgeo.org/postgis/trunk@11145 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c index a293fc3bc..e556cf254 100644 --- a/raster/loader/raster2pgsql.c +++ b/raster/loader/raster2pgsql.c @@ -78,9 +78,11 @@ raster_destroy(rt_raster raster) { uint16_t nbands = rt_raster_get_num_bands(raster); for (i = 0; i < nbands; i++) { rt_band band = rt_raster_get_band(raster, i); + if (band == NULL) continue; + if (!rt_band_is_offline(band) && !rt_band_get_ownsdata_flag(band)) { - void* mem = rt_band_get_data(band); - if (mem) rtdealloc(mem); + void* mem = rt_band_get_data(band); + if (mem) rtdealloc(mem); } rt_band_destroy(band); } @@ -648,7 +650,7 @@ diff_rastinfo(RASTERINFO *x, RASTERINFO *ref) { err = rt_raster_same_alignment(rx, rref, &aligned, NULL); rt_raster_destroy(rx); rt_raster_destroy(rref); - if (!err) { + if (err != ES_NONE) { rterror(_("diff_rastinfo: Could not run raster alignment test")); return; } diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 8f124ff07..fe01b398b 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -7587,7 +7587,8 @@ rt_raster_from_hexwkb(const char* hexwkb, uint32_t hexwkbsize) { assert(NULL != hexwkb); - RASTER_DEBUGF(3, "rt_raster_from_hexwkb: input wkb: %s", hexwkb); + RASTER_DEBUGF(3, "input wkb: %s", hexwkb); + RASTER_DEBUGF(3, "input wkbsize: %s", hexwkbsize); if (hexwkbsize % 2) { rterror("rt_raster_from_hexwkb: Raster HEXWKB input must have an even number of characters");