]> granicus.if.org Git - postgis/commitdiff
Explicitly initialize memory as valgrind complains
authorBborie Park <bkpark at ucdavis.edu>
Tue, 23 Apr 2013 19:32:18 +0000 (19:32 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 23 Apr 2013 19:32:18 +0000 (19:32 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11313 b70326c6-7e19-0410-871a-916f4a2858ee

raster/test/cunit/cu_tester.c

index 1626a484aeca991d7da54f346cccca863421edb9..ab11902620ddd58b102fca660c75a8026a774f6d 100644 (file)
@@ -233,6 +233,11 @@ rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double
        mem = rtalloc(datasize);
        CU_ASSERT(mem != NULL);
 
+       if (hasnodata)
+               memset(mem, nodataval, datasize);
+       else
+               memset(mem, 0, datasize);
+
        band = rt_band_new_inline(width, height, pixtype, hasnodata, nodataval, mem);
        CU_ASSERT(band != NULL);
        rt_band_set_ownsdata_flag(band, 1);