Reset invalid media box to letter size.

This commit is contained in:
notmasteryet 2011-09-23 18:08:23 -05:00
parent b8c7030309
commit ced260c2ff

6
pdf.js
View File

@ -3321,8 +3321,10 @@ var Page = (function pagePage() {
}, },
get mediaBox() { get mediaBox() {
var obj = this.inheritPageProp('MediaBox'); var obj = this.inheritPageProp('MediaBox');
return shadow(this, 'mediaBox', // Reset invalid media box to letter size.
((IsArray(obj) && obj.length == 4) ? obj : null)); if (!IsArray(obj) || obj.length === 4)
obj = [0, 0, 612, 792];
return shadow(this, 'mediaBox', obj);
}, },
get view() { get view() {
var obj = this.inheritPageProp('CropBox'); var obj = this.inheritPageProp('CropBox');