[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Thu Jan 25 20:32:02 UTC 2018
filter/source/msfilter/svdfppt.cxx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit cf4e7f122ac80399d8ead31e4f5d5732c864be97
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jan 25 14:33:22 2018 +0000
clamp normal page sizes as well as notepages
max multiplication is about 4.4 based on
SvxMSDffManager::SetModel nMapMul/nMapDiv
Change-Id: I97bc6ad76bb43fb46aa521bf852decfdd17883e7
Reviewed-on: https://gerrit.libreoffice.org/48612
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 3779ea408e3f..bb44fae227dd 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -281,11 +281,13 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom)
.ReadSChar( nTitlePlaceHoldersOmitted )
.ReadSChar( nRightToLeft )
.ReadSChar( nShowComments );
- rAtom.aSlidesPageSize.Width() = nSlideX;
- rAtom.aSlidesPageSize.Height() = nSlideY;
// 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);
+ const sal_Int32 nPageClamp = SAL_MAX_INT32/5;
+ rAtom.aSlidesPageSize.Width() = basegfx::clamp<sal_Int32>(nSlideX, -nPageClamp, nPageClamp);
+ rAtom.aSlidesPageSize.Height() = basegfx::clamp<sal_Int32>(nSlideY, -nPageClamp, nPageClamp);
+ const sal_Int32 nNoteClamp = 65536;
+ rAtom.aNotesPageSize.Width() = basegfx::clamp<sal_Int32>(nNoticeX, -nNoteClamp, nNoteClamp);
+ rAtom.aNotesPageSize.Height() = basegfx::clamp<sal_Int32>(nNoticeY, -nNoteClamp, nNoteClamp);
rAtom.eSlidesPageFormat = static_cast<PptPageFormat>(nSlidePageFormat);
rAtom.bEmbeddedTrueType = nEmbeddedTrueType;
rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;
More information about the Libreoffice-commits
mailing list