Package: lcms2
Version: 2.2+git20110628-2
Severity: important
Tags: upstream patch
Justification: fails to build from source (but built successfully in the past)
User: debian-sp...@lists.debian.org
Usertags: sparc64

The memory allocator of lcms2 tries to get the returned pointer aligned
by using the _cmsALIGNLONG macro, but this macro is designed to handle
the I/O alignement in ICC files, not the host addresses alignment.

On 64-bit architectures without unaligned access, it means the pointers
are aligned to 4 bytes instead of 8 bytes, causing SIGBUS in the
testsuite.

The patch below fixes the problem by aligning on the pointer size. Would
it be possible to include it in the next upload? Thanks in advance.


--- lcms2-2.2+git20110628.orig/src/cmscgats.c
+++ lcms2-2.2+git20110628/src/cmscgats.c
@@ -982,7 +982,7 @@ void* AllocChunk(cmsIT8* it8, cmsUInt32N
     cmsUInt32Number Free = it8 ->Allocator.BlockSize - it8 ->Allocator.Used;
     cmsUInt8Number* ptr;
 
-    size = _cmsALIGNLONG(size);
+    size = (size + (sizeof(void *) - 1)) & ~(sizeof(void *) - 1);
 
     if (size > Free) {
 

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: sparc64

Kernel: Linux 2.6.32-bpo.5-sparc64-smp (SMP w/32 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to