From: Landry Breuil <landry@openbsd.org>
Date: Fri, 25 Mar 2011 04:04:18 -3600
Subject: Bug 643137 - strict alignment issues when displaying OpenType fonts
 on sparc64. r=roc

---
 gfx/ots/include/opentype-sanitiser.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
index 5f6d191..8c656e2 100644
--- a/gfx/ots/include/opentype-sanitiser.h
+++ b/gfx/ots/include/opentype-sanitiser.h
@@ -64,8 +64,10 @@ class OTSStream {
     }
 
     while (length >= 4) {
-      chksum_ += ntohl(*reinterpret_cast<const uint32_t*>(
-          reinterpret_cast<const uint8_t*>(data) + offset));
+      uint32_t tmp;
+      std::memcpy(&tmp, reinterpret_cast<const uint8_t *>(data) + offset,
+        sizeof(uint32_t));
+      chksum_ += ntohl(tmp);
       length -= 4;
       offset += 4;
     }
