diff options
author | Albert Astals Cid <aacid@kde.org> | 2021-12-10 10:42:22 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2021-12-10 10:42:22 +0100 |
commit | e73a2b3a0a93f60c4e90933f930f506df20935bd (patch) | |
tree | 8a5cd00d738db4e0d64af8b62abfc4e4567ff9f9 /poppler/PSOutputDev.cc | |
parent | c99378fe823256383810941123c1e1478369340a (diff) |
PSOutputDev::startPage: Fix potential integer overflow
Diffstat (limited to 'poppler/PSOutputDev.cc')
-rw-r--r-- | poppler/PSOutputDev.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 972945f1..140bde80 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -3708,7 +3708,10 @@ void PSOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) error(errSyntaxError, -1, "width too big"); return; } - height = y2 - y1; + if (unlikely(checkedSubtraction(y2, y1, &height))) { + error(errSyntaxError, -1, "height too big"); + return; + } tx = ty = 0; // rotation and portrait/landscape mode if (paperMatch) { |