Skip to content

Commit f954cde

Browse files
committed
Merge pull request #4581 from Snuffleupagus/issue-4575
Check that images have valid dimensions (issue 4575)
2 parents eb8924a + 3a9b5b3 commit f954cde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/evaluator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
139139
var w = dict.get('Width', 'W');
140140
var h = dict.get('Height', 'H');
141141

142+
if (!(w && isNum(w)) || !(h && isNum(h))) {
143+
warn('Image dimensions are missing, or not numbers.');
144+
return;
145+
}
142146
if (PDFJS.maxImageSize !== -1 && w * h > PDFJS.maxImageSize) {
143147
warn('Image exceeded maximum allowed size and was removed.');
144148
return;

0 commit comments

Comments
 (0)