gfx/ots/ots-fix-sparc64.patch
author Myk Melez <myk@mozilla.org>
Sat, 21 Apr 2012 11:41:50 -0700
changeset 95372 97170e7a5f844cf0fdd2c62c7f1df9dab2714912
parent 68767 32f760d04b38a52dfae7c6a9bc5d22430baf4d79
child 98773 7ffffcb45b9402c0b2cb12e8fdd0d8293a7e48fb
permissions -rw-r--r--
bug 747394 - rename webapprt/application.ini to webapprt/webapprt.ini to work around an issue in a build script that looks for Firefox's application.ini, which busted nightly partial updates, on a CLOSED TREE; r=bsmedberg, a=khuey

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
@@ -57,18 +57,20 @@ class OTSStream {
 
     if (chksum_buffer_offset_ == 4) {
       // TODO(yusukes): This cast breaks the strict-aliasing rule.
       chksum_ += ntohl(*reinterpret_cast<const uint32_t*>(chksum_buffer_));
       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_,