diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-25 14:33:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-25 21:31:35 +0100 |
commit | cf4e7f122ac80399d8ead31e4f5d5732c864be97 (patch) | |
tree | 62fd2c4e6345793339fa5c6c2199007b8d90533c /filter | |
parent | 0628693eaf056fedf4d82be8f58f0b87ab7dc20b (diff) |
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@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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; |