From 03547b5633f51ebe7687be0db8b7a0df432559b2 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 15 Jul 2020 14:25:24 +0200 Subject: [PATCH] Change `PartialEvaluator.setGState` to an `async` method Since this method calls `Dict.get` to fetch data, there could thus be `Error`s thrown in corrupt PDF documents when attempting to resolve an indirect object. To ensure that this won't ever become a problem, we change the method to be `async` such that a rejected Promise would be returned and general OperatorList parsing won't break. --- src/core/evaluator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 5739f372f..96bc5ff5b 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -832,7 +832,7 @@ class PartialEvaluator { throw reason; } - setGState({ + async setGState({ resources, gState, operatorList,