diff --git a/bower.json b/bower.json index e666f7f45..5e316948d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.494", + "version": "1.5.496", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index e5da0a308..7f01635b2 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.5.494'; -var pdfjsBuild = 'b4be1e9'; +var pdfjsVersion = '1.5.496'; +var pdfjsBuild = '8699145'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -11509,6 +11509,12 @@ var JpegImage = (function JpegImageClosure() { // find marker bitsCount = 0; marker = (data[offset] << 8) | data[offset + 1]; + // Some bad images seem to pad Scan blocks with zero bytes, skip past + // those to attempt to find a valid marker (fixes issue4090.pdf). + while (data[offset] === 0x00 && offset < data.length - 1) { + offset++; + marker = (data[offset] << 8) | data[offset + 1]; + } if (marker <= 0xFF00) { error('JPEG error: marker was not found'); } diff --git a/build/pdf.js b/build/pdf.js index aa7c48acd..08303a4ca 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.5.494'; -var pdfjsBuild = 'b4be1e9'; +var pdfjsVersion = '1.5.496'; +var pdfjsBuild = '8699145'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 5fa6d147b..2fc5d6b44 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.5.494'; -var pdfjsBuild = 'b4be1e9'; +var pdfjsVersion = '1.5.496'; +var pdfjsBuild = '8699145'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -11509,6 +11509,12 @@ var JpegImage = (function JpegImageClosure() { // find marker bitsCount = 0; marker = (data[offset] << 8) | data[offset + 1]; + // Some bad images seem to pad Scan blocks with zero bytes, skip past + // those to attempt to find a valid marker (fixes issue4090.pdf). + while (data[offset] === 0x00 && offset < data.length - 1) { + offset++; + marker = (data[offset] << 8) | data[offset + 1]; + } if (marker <= 0xFF00) { error('JPEG error: marker was not found'); } diff --git a/package.json b/package.json index bb47714dd..40a247b46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.494", + "version": "1.5.496", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [