From 1325a65ebf9fd3e8e3055259811ac44ec4227188 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Sat, 21 Jul 2018 14:20:52 +0000 Subject: [PATCH] 32bit allocations are 4-byte aligned, not 8-byte aligned. Fix 8-bit alignment assumption in padding to match assert. Passes tests on 32bit Ubuntu Artful. References #3994 git-svn-id: http://svn.osgeo.org/postgis/trunk@16654 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_core/rt_serialize.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/raster/rt_core/rt_serialize.c b/raster/rt_core/rt_serialize.c index 9d17aa028..eb5a87715 100644 --- a/raster/rt_core/rt_serialize.c +++ b/raster/rt_core/rt_serialize.c @@ -688,11 +688,9 @@ rt_raster_serialize(rt_raster raster) { #endif /* Pad up to 8-bytes boundary */ - while ((uintptr_t) ptr % 8) { + while ((ptr-ret) % 8) { *ptr = 0; ++ptr; - - RASTER_DEBUGF(3, "PAD at %d", (uintptr_t) ptr % 8); } /* Consistency checking (ptr is pixbytes-aligned) */ -- 2.40.0