mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Check that images have valid dimensions (issue 4575)
This commit is contained in:
parent
608c6cea5a
commit
3a9b5b3951
1 changed files with 4 additions and 0 deletions
|
@ -140,6 +140,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…
Add table
Add a link
Reference in a new issue