[Pkg-javascript-commits] [pdf.js] 11/157: Ensure that we fetch all indirect objects (i.e. |Ref|s) in ColorSpace_parseToIR

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 06:46:25 UTC 2015


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

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

commit bc865b9e2dc24dd67807581d1962e5ac737b379b
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Tue Jun 16 15:38:50 2015 +0200

    Ensure that we fetch all indirect objects (i.e. |Ref|s) in ColorSpace_parseToIR
    
    Recently I've landed a number patches which fixed issues with ColorSpaces. In most of these cases the cause of the failures were, either partially or entirely, related to the fact that we didn't resolve indirect objects (i.e. the code was missing `xref.fetchIfRef(...)`).
    
    The purpose of this patch is to fix the few remaining cases where indirect objects *could* potentially cause failures.
    Given that we have seen how this causes failures in practice, I thus think that it makes sense to try and avoid further issues, instead of waiting for users to file even more bugs for this part of the code-base.
---
 src/core/colorspace.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/colorspace.js b/src/core/colorspace.js
index 5daa7cc..6277e86 100644
--- a/src/core/colorspace.js
+++ b/src/core/colorspace.js
@@ -304,7 +304,7 @@ var ColorSpace = (function ColorSpaceClosure() {
           }
           break;
         case 'Pattern':
-          var basePatternCS = xref.fetchIfRef(cs[1]) || null;
+          var basePatternCS = cs[1] || null;
           if (basePatternCS) {
             basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res);
           }
@@ -312,7 +312,7 @@ var ColorSpace = (function ColorSpaceClosure() {
         case 'Indexed':
         case 'I':
           var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res);
-          var hiVal = cs[2] + 1;
+          var hiVal = xref.fetchIfRef(cs[2]) + 1;
           var lookup = xref.fetchIfRef(cs[3]);
           if (isStream(lookup)) {
             lookup = lookup.getBytes();
@@ -320,7 +320,7 @@ var ColorSpace = (function ColorSpaceClosure() {
           return ['IndexedCS', baseIndexedCS, hiVal, lookup];
         case 'Separation':
         case 'DeviceN':
-          var name = cs[1];
+          var name = xref.fetchIfRef(cs[1]);
           numComps = 1;
           if (isName(name)) {
             numComps = 1;

-- 
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