diff --git a/bower.json b/bower.json index fcb586da1..8c7f76b19 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.46", + "version": "1.4.48", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 20bf0621f..1f4507a19 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.46'; -var pdfjsBuild = 'd7e5935'; +var pdfjsVersion = '1.4.48'; +var pdfjsBuild = '02b161d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -38743,15 +38743,21 @@ var Type1Parser = (function Type1ParserClosure() { } function decrypt(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length; + if (discardNumber >= data.length) { + return new Uint8Array(0); + } + var r = key | 0, c1 = 52845, c2 = 22719, i, j; + for (i = 0; i < discardNumber; i++) { + r = ((data[i] + r) * c1 + c2) & ((1 << 16) - 1); + } + var count = data.length - discardNumber; var decrypted = new Uint8Array(count); - for (var i = 0; i < count; i++) { + for (i = discardNumber, j = 0; j < count; i++, j++) { var value = data[i]; - decrypted[i] = value ^ (r >> 8); + decrypted[j] = value ^ (r >> 8); r = ((value + r) * c1 + c2) & ((1 << 16) - 1); } - return Array.prototype.slice.call(decrypted, discardNumber); + return decrypted; } function decryptAscii(data, key, discardNumber) { diff --git a/build/pdf.js b/build/pdf.js index d15f2c9c7..23e9699d1 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.46'; -var pdfjsBuild = 'd7e5935'; +var pdfjsVersion = '1.4.48'; +var pdfjsBuild = '02b161d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index cdcca9653..8fee9b939 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.46'; -var pdfjsBuild = 'd7e5935'; +var pdfjsVersion = '1.4.48'; +var pdfjsBuild = '02b161d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -30892,15 +30892,21 @@ var Type1Parser = (function Type1ParserClosure() { } function decrypt(data, key, discardNumber) { - var r = key | 0, c1 = 52845, c2 = 22719; - var count = data.length; + if (discardNumber >= data.length) { + return new Uint8Array(0); + } + var r = key | 0, c1 = 52845, c2 = 22719, i, j; + for (i = 0; i < discardNumber; i++) { + r = ((data[i] + r) * c1 + c2) & ((1 << 16) - 1); + } + var count = data.length - discardNumber; var decrypted = new Uint8Array(count); - for (var i = 0; i < count; i++) { + for (i = discardNumber, j = 0; j < count; i++, j++) { var value = data[i]; - decrypted[i] = value ^ (r >> 8); + decrypted[j] = value ^ (r >> 8); r = ((value + r) * c1 + c2) & ((1 << 16) - 1); } - return Array.prototype.slice.call(decrypted, discardNumber); + return decrypted; } function decryptAscii(data, key, discardNumber) { diff --git a/package.json b/package.json index 29902f1c8..a983bcc68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.46", + "version": "1.4.48", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [