summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-03 14:25:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-05 10:41:53 +0100
commitadf0738d2dbfa742d0e9ef130954fb4638a8e90d (patch)
tree46798a23d0ddd43ec82563b52500ee8ed520857e /filter
parent24a7df66149a907c2ca2e757927c6c88ecadc523 (diff)
long->sal_Int32 in BigInt
And fix an issue discovered in the PPT parsing, where one of the test files has dodgy values that trigger the assert in BigInt::operator long(). Change-Id: Ic324ac38ecef4153cc434376317643ababe0a537 Reviewed-on: https://gerrit.libreoffice.org/47314 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/svdfppt.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index bc1ccb59f2dd..8d99c712d2e8 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -288,8 +288,9 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom)
.ReadSChar( nShowComments );
rAtom.aSlidesPageSize.Width() = nSlideX;
rAtom.aSlidesPageSize.Height() = nSlideY;
- rAtom.aNotesPageSize.Width() = nNoticeX;
- rAtom.aNotesPageSize.Height() = nNoticeY;
+ // clamp dodgy data to avoid overflow in later calculations
+ rAtom.aNotesPageSize.Width() = std::min<sal_Int32>(nNoticeX, 65536);
+ rAtom.aNotesPageSize.Height() = std::min<sal_Int32>(nNoticeY, 65536);
rAtom.eSlidesPageFormat = (PptPageFormat)nSlidePageFormat;
rAtom.bEmbeddedTrueType = nEmbeddedTrueType;
rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;