Kaydet (Commit) 3dabb069 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

-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
üst 4ce8c21a
...@@ -1098,8 +1098,10 @@ Rectangle SdPage::GetTitleRect() const ...@@ -1098,8 +1098,10 @@ Rectangle SdPage::GetTitleRect() const
if ( pRefPage ) if ( pRefPage )
{ {
// scale actually page size into handout rectangle // scale actually page size into handout rectangle
double fH = (double) aPartArea.Width() / pRefPage->GetWdt(); double fH = pRefPage->GetWdt() == 0
double fV = (double) aPartArea.Height() / pRefPage->GetHgt(); ? 0 : (double) aPartArea.Width() / pRefPage->GetWdt();
double fV = pRefPage->GetHgt() == 0
? 0 : (double) aPartArea.Height() / pRefPage->GetHgt();
if ( fH > fV ) if ( fH > fV )
fH = fV; fH = fV;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment