diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-08-31 18:12:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-08-31 18:16:39 +0200 |
commit | 3dabb0692d496684ba145cc95884a731ca1cd5b0 (patch) | |
tree | 41c9191aba4f0c211d4d97ddc99867d20d9cb01f /sd | |
parent | 4ce8c21a096d17be9cc40afe11f683c7b3d9fd70 (diff) |
-fsanitize=float-divide-by-zero
...as happens in CppunitTest_sd_filters_test with
sd/qa/unit/data/ppt/pass/hang-16.ppt:
> sd/source/core/sdpage.cxx:1101:57: runtime error: division by zero
> SdPage::GetTitleRect() const sd/source/core/sdpage.cxx:1101:57
> CalcAutoLayoutRectangles(SdPage&, Rectangle*, rtl::OUString const&) sd/source/core/sdpage.cxx:1323:26
> SdPage::SetAutoLayout(AutoLayout, bool, bool) sd/source/core/sdpage.cxx:1595:5
> ImplSdPPTImport::Import() sd/source/filter/ppt/pptin.cxx:1025:21
> SdPPTImport::Import() sd/source/filter/ppt/pptin.cxx:161:12
> ImportPPT sd/source/filter/ppt/pptin.cxx:2744:17
> SdPPTFilter::Import() sd/source/filter/sdpptwrp.cxx:108:32
> sd::DrawDocShell::ConvertFrom(SfxMedium&) sd/source/ui/docshell/docshel4.cxx:453:16
> SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:790:23
> SdFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) sd/qa/unit/filters-test.cxx:75:20
Change-Id: Ic6a339c0315e9bc3f28de8c26c3d9f2767c3509d
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/sdpage.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index cce381738bae..9caab81a83bb 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1098,8 +1098,10 @@ Rectangle SdPage::GetTitleRect() const if ( pRefPage ) { // scale actually page size into handout rectangle - double fH = (double) aPartArea.Width() / pRefPage->GetWdt(); - double fV = (double) aPartArea.Height() / pRefPage->GetHgt(); + double fH = pRefPage->GetWdt() == 0 + ? 0 : (double) aPartArea.Width() / pRefPage->GetWdt(); + double fV = pRefPage->GetHgt() == 0 + ? 0 : (double) aPartArea.Height() / pRefPage->GetHgt(); if ( fH > fV ) fH = fV; |