[Pkg-javascript-commits] [pdf.js] 49/141: Check that images have valid dimensions (issue 4575)

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 22:40:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 3a9b5b39513f142ab293c71d7d18f70ff94bdada
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Wed Apr 9 13:04:27 2014 +0200

    Check that images have valid dimensions (issue 4575)
---
 src/core/evaluator.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index d8ce942..2b01c31 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list