Browse Source

Merge pull request #4581 from Snuffleupagus/issue-4575

Check that images have valid dimensions (issue 4575)
v1.0.21
Yury Delendik 11 years ago
parent
commit
f954cde8f4
  1. 4
      src/core/evaluator.js

4
src/core/evaluator.js

@ -139,6 +139,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { @@ -139,6 +139,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var w = dict.get('Width', 'W');
var h = dict.get('Height', 'H');
if (!(w && isNum(w)) || !(h && isNum(h))) {
warn('Image dimensions are missing, or not numbers.');
return;
}
if (PDFJS.maxImageSize !== -1 && w * h > PDFJS.maxImageSize) {
warn('Image exceeded maximum allowed size and was removed.');
return;

Loading…
Cancel
Save