gfx/ots/ots-fix-sparc64.patch
author Mike Hommey <mh+mozilla@glandium.org>
Thu, 05 Sep 2013 09:01:46 +0900
changeset 153593 45097bc3a57898f22a4f3b74f8f8cf7511f5d0a4
parent 96986 7ffffcb45b9402c0b2cb12e8fdd0d8293a7e48fb
permissions -rw-r--r--
Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps

diff --git a/gfx/ots/include/opentype-sanitiser.h b/gfx/ots/include/opentype-sanitiser.h
--- a/gfx/ots/include/opentype-sanitiser.h
+++ b/gfx/ots/include/opentype-sanitiser.h
@@ -83,18 +83,20 @@ class OTSStream {
     if (chksum_buffer_offset_ == 4) {
       uint32_t chksum;
       std::memcpy(&chksum, chksum_buffer_, 4);
       chksum_ += ntohl(chksum);
       chksum_buffer_offset_ = 0;
     }
 
     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;
     }
 
     if (length) {
       if (chksum_buffer_offset_ != 0) return false;  // not reached
       if (length > 4) return false;  // not reached
       std::memcpy(chksum_buffer_,