summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorAdam Reichold <adam.reichold@t-online.de>2018-08-30 20:56:33 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2018-08-31 07:13:17 +0000
commited28a5612fc0bf8580ccd360ae086fc715d19b35 (patch)
tree0de66de3090d490d00cb2710113f7923d0f757ab /fofi
parentde20e92a70e73d828984f41f52212051fba51700 (diff)
Fix delta decoding for Type1C fonts to avoid signed integer overflow. oss-fuzz/8424
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiType1C.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index caa4b42b..63518452 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -2663,7 +2663,11 @@ int FoFiType1C::getDeltaIntArray(int *arr, int maxLen) {
}
x = 0;
for (i = 0; i < n; ++i) {
- x += (int)ops[i].num;
+ int y;
+ if (checkedAdd(x, (int)ops[i].num, &y)) {
+ return i;
+ }
+ x = y;
arr[i] = x;
}
return n;