summaryrefslogtreecommitdiff
path: root/poppler/PSOutputDev.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2021-04-16 22:49:29 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2021-04-16 20:56:04 +0000
commit3554a152a9badfde6c02bb0001755a7e9c830b32 (patch)
tree568c58b2429af5b6fd0b4bbb09c1871c9799e1de /poppler/PSOutputDev.cc
parent0e732883671754fff843c9e869bdc43f4ab6d4db (diff)
Prevent integer overflow PSOutputDev::checkPageSlice
oss-fuzz/33333
Diffstat (limited to 'poppler/PSOutputDev.cc')
-rw-r--r--poppler/PSOutputDev.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 9ce6648f..2ab62748 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -3244,7 +3244,12 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i
sliceW = (int)((box.x2 - box.x1) * hDPI2 / 72.0);
sliceH = (int)((box.y2 - box.y1) * vDPI2 / 72.0);
}
- nStripes = (int)ceil((double)(sliceW * sliceH) / (double)rasterizationSliceSize);
+ int sliceArea;
+ if (checkedMultiply(sliceW, sliceH, &sliceArea)) {
+ delete splashOut;
+ return false;
+ }
+ nStripes = (int)ceil((double)(sliceArea) / (double)rasterizationSliceSize);
if (unlikely(nStripes == 0)) {
delete splashOut;
return false;