Skip to content

Commit

Permalink
Merge pull request #4581 from Snuffleupagus/issue-4575
Browse files Browse the repository at this point in the history
Check that images have valid dimensions (issue 4575)
  • Loading branch information
yurydelendik committed Apr 14, 2014
2 parents eb8924a + 3a9b5b3 commit f954cde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f954cde

Please sign in to comment.