about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-08-13 01:39:20 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-08-13 01:39:20 +0000
commit46b5b8da8357e7785760d83b79a75ceff1c61073 (patch)
tree6836f0153559f61a1898f654acd2ee04d555c208
parentc0a081a4f8166e3f1195725df2d2b41bb3dc3a4f (diff)
downloadnetpbm-mirror-46b5b8da8357e7785760d83b79a75ceff1c61073.tar.gz
netpbm-mirror-46b5b8da8357e7785760d83b79a75ceff1c61073.tar.xz
netpbm-mirror-46b5b8da8357e7785760d83b79a75ceff1c61073.zip
Release 10.73.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2810 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/giftopnm.c9
-rw-r--r--doc/HISTORY8
-rw-r--r--pm_config.in.h11
-rw-r--r--version.mk2
4 files changed, 18 insertions, 12 deletions
diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c
index 2e6ae1d9..76cf4bff 100644
--- a/converter/other/giftopnm.c
+++ b/converter/other/giftopnm.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <assert.h>
 
+#include "pm_config.h"
 #include "pm_c_util.h"
 #include "mallocvar.h"
 #include "nstring.h"
@@ -39,12 +40,6 @@
 
 #define MAX_LZW_BITS  12
 
-#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN)
-  /* make sure (BYTE_ORDER == LITTLE_ENDIAN) is FALSE */ 
-  #define BYTE_ORDER    0
-  #define LITTLE_ENDIAN 1
-#endif
-
 #ifndef   FASTPBMRENDER
   #define FASTPBMRENDER TRUE
 #endif
@@ -684,7 +679,7 @@ bitsOfLeBuffer(const unsigned char * const buf,
 
     assert(len <= 16);
 
-    if (BYTE_ORDER == LITTLE_ENDIAN)
+    if (BYTE_ORDER == LITTLE_ENDIAN && UNALIGNED_OK)
         /* Fast path */
         codeBlock = *(uint32_t *) & buf[start/8];
     else
diff --git a/doc/HISTORY b/doc/HISTORY
index d5c93729..28e892c9 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,10 +4,16 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+16.08.13 BJH  Release 10.73.04
+
+              giftopnm: Fix bug: crash on little-endian computers that can't
+              toleration unaligned memory access.  Thanks Ignatios Souvatzis
+              (is@netbsd.org).  Broken in Netpbm 10.47 (June 2009).
+
 16.06.26 BJH  Release 10.73.03
 
               pamarith: fix incorrect output when maxvals differ, for
-              -add, -multiply, -mean, -min, -max.  Broken in Neptbm 10.41
+              -add, -multiply, -mean, -min, -max.  Broken in Netpbm 10.41
               (December 2007).
 
 16.06.12 BJH  Release 10.73.02
diff --git a/pm_config.in.h b/pm_config.in.h
index 9d0dc303..fe8b8008 100644
--- a/pm_config.in.h
+++ b/pm_config.in.h
@@ -257,12 +257,17 @@
 /* UNALIGNED_OK means it's OK to do unaligned memory access, e.g.
    loading an 8-byte word from an address that is not a multiple of 8.
    On some systems, such an access causes a trap and a signal.
+
+   This determination is conservative - There may be cases where unaligned
+   access is OK and we say here it isn't.
+
+   We know unaligned access is _not_ OK on at least SPARC and some ARM.
 */
 
-#if defined(__sparc__)
-# define UNALIGNED_OK 0
-#else
+#if defined(__x86_64__) | defined(__i486__) | defined(__vax__)
 # define UNALIGNED_OK 1
+#else
+# define UNALIGNED_OK 0
 #endif
 
 
diff --git a/version.mk b/version.mk
index d54d63ed..0f1fa602 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 73
-NETPBM_POINT_RELEASE = 3
+NETPBM_POINT_RELEASE = 4