]> granicus.if.org Git - postgis/commitdiff
Minor code cleanup in raster2pgsql and additional debug output for
authorBborie Park <bkpark at ucdavis.edu>
Tue, 5 Mar 2013 16:57:49 +0000 (16:57 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 5 Mar 2013 16:57:49 +0000 (16:57 +0000)
rt_api

git-svn-id: http://svn.osgeo.org/postgis/trunk@11145 b70326c6-7e19-0410-871a-916f4a2858ee

raster/loader/raster2pgsql.c
raster/rt_core/rt_api.c

index a293fc3bce480acdcef52e68ebb732318956fb52..e556cf2542dd462d422d03279c7766fb17464527 100644 (file)
@@ -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;
                }
index 8f124ff073f3aa616bbdf5d61bec7f639d121989..fe01b398b7ac825207b3c8b99285dd5a3083b747 100644 (file)
@@ -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");