Bug 1018679 - History/Bookmarks migration from Safari fails if the corresponding Property List file uses 3-byte integers. r=mak
authorAsaf Romano <mano@mozilla.com>
Wed, 09 Jul 2014 21:21:47 +0300
changeset 193070 737cb19ee1c488c65665726e3af59c0da98675a5
parent 193069 13d9e025fc86e727793af1d30dbee89993149cde
child 193071 04cf8536314c0159e67831c786ed51d85a61b113
push id7673
push useraromano@mozilla.com
push dateWed, 09 Jul 2014 18:21:58 +0000
treeherderfx-team@737cb19ee1c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1018679
milestone33.0a1
Bug 1018679 - History/Bookmarks migration from Safari fails if the corresponding Property List file uses 3-byte integers. r=mak
toolkit/modules/PropertyListUtils.jsm
--- a/toolkit/modules/PropertyListUtils.jsm
+++ b/toolkit/modules/PropertyListUtils.jsm
@@ -403,16 +403,24 @@ BinaryPropertyListReader.prototype = {
          offset < aByteOffset + aIntSize * aLength;
          offset += aIntSize) {
       if (aIntSize == 1) {
         uints.push(this._dataView.getUint8(offset));
       }
       else if (aIntSize == 2) {
         uints.push(this._dataView.getUint16(offset));
       }
+      else if (aIntSize == 3) {
+        let int24 = Uint8Array(4);
+        int24[3] = 0;
+        int24[2] = this._dataView.getUint8(offset);
+        int24[1] = this._dataView.getUint8(offset + 1);
+        int24[0] = this._dataView.getUint8(offset + 2);
+        uints.push(Uint32Array(int24.buffer)[0]);
+      }
       else if (aIntSize == 4) {
         uints.push(this._dataView.getUint32(offset));
       }
       else if (aIntSize == 8) {
         let lo = this._dataView.getUint32(offset + 4);
         let hi = this._dataView.getUint32(offset);
         let uint64 = ctypes.UInt64.join(hi, lo);
         if (ctypes.UInt64.compare(uint64, this._JS_MAX_INT_UNSIGNED) == 1) {