Ignore paint form XObject when the name is missing (issue 4558)

Fixes 4558 (since the font issues already appear to be fixed).
This commit is contained in:
Jonas Jenwald 2015-06-22 13:33:15 +02:00
parent 99415a75b7
commit 46a8485db4
2 changed files with 15 additions and 0 deletions

View File

@ -658,6 +658,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
// eagerly compile XForm objects
var name = args[0].name;
if (!name) {
warn('XObject must be referred to by name.');
continue;
}
if (imageCache[name] !== undefined) {
operatorList.addOp(imageCache[name].fn, imageCache[name].args);
args = null;

View File

@ -227,5 +227,16 @@ describe('evaluator', function() {
expect(result.fnArray[3]).toEqual(OPS.restore);
});
});
it('should skip paint form XObject if name is missing', function() {
var evaluator = new PartialEvaluator(new PdfManagerMock(),
new XrefMock(), new HandlerMock(),
'prefix');
var stream = new StringStream('/ Do');
runOperatorListCheck(evaluator, stream, new ResourcesMock(),
function (result) {
expect(result.argsArray).toEqual([]);
expect(result.fnArray).toEqual([]);
});
});
});
});