diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-09-11 18:24:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-09-11 22:05:29 +0200 |
commit | 0a7752b39884cfb7d4d679683fb216a44a85326a (patch) | |
tree | cac03537c5535aec91f777ab0af65aaa685da82d /svx/source | |
parent | 6f80e2d37ce11e3ea728b7ce5987f912fdfa60b3 (diff) |
Handle empty rRange in OverlayManager::RangeToInvalidateRectangle
Not sure why it started to happen just now, but my Linux UBSan build now failed
CppunitTest_sd_tiledrendering with
> svx/source/sdr/overlay/overlaymanager.cxx:290:44: runtime error: 1.79769e+308 is outside the range of representable values of type 'int'
> #0 in sdr::overlay::OverlayManager::RangeToInvalidateRectangle(basegfx::B2DRange const&) const at svx/source/sdr/overlay/overlaymanager.cxx:290:44
> #1 in sdr::overlay::OverlayManager::invalidateRange(basegfx::B2DRange const&) at svx/source/sdr/overlay/overlaymanager.cxx:311:55
> #2 in sdr::overlay::OverlayManager::impApplyRemoveActions(sdr::overlay::OverlayObject&) at svx/source/sdr/overlay/overlaymanager.cxx:186:13
> #3 in sdr::overlay::OverlayManager::~OverlayManager() at svx/source/sdr/overlay/overlaymanager.cxx:224:21
> #4 in sdr::overlay::OverlayManagerBuffered::~OverlayManagerBuffered() at svx/source/sdr/overlay/overlaymanagerbuffered.cxx:377:9
> #5 in sdr::overlay::OverlayManagerBuffered::~OverlayManagerBuffered() at svx/source/sdr/overlay/overlaymanagerbuffered.cxx:368:9
> #6 in salhelper::SimpleReferenceObject::release() at include/salhelper/simplereferenceobject.hxx:72:49
> #7 in rtl::Reference<sdr::overlay::OverlayManager>::clear() at include/rtl/ref.hxx:180:19
> #8 in SdrPaintWindow::~SdrPaintWindow() at svx/source/svdraw/sdrpaintwindow.cxx:251:22
[...]
> #16 in SdrPaintView::DeletePaintWindow(SdrPaintWindow&) at svx/source/svdraw/svdpntv.cxx:83:24
> #17 in SdrPaintView::DeleteWindowFromPaintView(OutputDevice*) at svx/source/svdraw/svdpntv.cxx:417:9
> #18 in SdrObjEditView::DeleteWindowFromPaintView(OutputDevice*) at svx/source/svdraw/svdedxv.cxx:2316:22
> #19 in FmFormView::DeleteWindowFromPaintView(OutputDevice*) at svx/source/form/fmview.cxx:196:14
> #20 in sd::View::~View() at sd/source/ui/view/sdview.cxx:148:9
> #21 in sd::DrawView::~DrawView() at sd/source/ui/view/drawview.cxx:75:1
> #22 in sd::DrawView::~DrawView() at sd/source/ui/view/drawview.cxx:74:1
[...]
> #34 in sd::framework::BasicViewFactory::releaseResource(com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResource> const&) at sd/source/ui/framework/factories/BasicViewFactory.cxx:229:1
> #35 in sd::framework::ConfigurationControllerResourceManager::DeactivateResource(com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> const&, com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfiguration> const&) at sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx:201:48
> #36 in sd::framework::ConfigurationControllerResourceManager::DeactivateResources(std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId>, std::allocator<com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> > > const&, com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfiguration> const&)::$_0::operator()(com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> const&) const at sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx:88:20
[...]
> #38 in sd::framework::ConfigurationControllerResourceManager::DeactivateResources(std::__debug::vector<com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId>, std::allocator<com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> > > const&, com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfiguration> const&) at sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx:84:5
> #39 in sd::framework::ConfigurationUpdater::UpdateCore(sd::framework::ConfigurationClassifier const&) at sd/source/ui/framework/configuration/ConfigurationUpdater.cxx:249:28
> #40 in sd::framework::ConfigurationUpdater::UpdateConfiguration() at sd/source/ui/framework/configuration/ConfigurationUpdater.cxx:160:21
> #41 in sd::framework::ConfigurationUpdater::RequestUpdate(com::sun::star::uno::Reference<com::sun::star::drawing::framework::XConfiguration> const&) at sd/source/ui/framework/configuration/ConfigurationUpdater.cxx:107:13
> #42 in sd::framework::ChangeRequestQueueProcessor::ProcessOneEvent() at sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx:161:33
> #43 in sd::framework::ChangeRequestQueueProcessor::ProcessUntilEmpty() at sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx:173:9
> #44 in sd::framework::ConfigurationController::disposing() at sd/source/ui/framework/configuration/ConfigurationController.cxx:126:41
> #45 in cppu::WeakComponentImplHelperBase::dispose() at cppuhelper/source/implbase.cxx:104:13
> #46 in cppu::PartialWeakComponentImplHelper<com::sun::star::drawing::framework::XConfigurationController, com::sun::star::lang::XInitialization>::dispose() at include/cppuhelper/compbase.hxx:90:36
> #47 in sd::DrawController::DisposeFrameworkControllers() at sd/source/ui/unoidl/DrawController.cxx:814:21
> #48 in sd::DrawController::dispose() at sd/source/ui/unoidl/DrawController.cxx:162:5
> #49 in (anonymous namespace)::XFrameImpl::setComponent(com::sun::star::uno::Reference<com::sun::star::awt::XWindow> const&, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) at framework/source/services/frame.cxx:1485:33
> #50 in (anonymous namespace)::XFrameImpl::close(unsigned char) at framework/source/services/frame.cxx:1692:12
> #51 in SfxFrame::DoClose() at sfx2/source/view/frame.cxx:109:29
> #52 in SfxViewFrame::Notify(SfxBroadcaster&, SfxHint const&) at sfx2/source/view/viewfrm.cxx:1534:28
> #53 in SfxBroadcaster::Broadcast(SfxHint const&) at svl/source/notify/SfxBroadcaster.cxx:49:24
> #54 in (anonymous namespace)::SfxModelListener_Impl::notifyClosing(com::sun::star::lang::EventObject const&) at sfx2/source/doc/objxtor.cxx:146:12
> #55 in SfxBaseModel::close(unsigned char) at sfx2/source/doc/sfxbasemodel.cxx:1439:76
> #56 in SfxBaseModel::dispose() at sfx2/source/doc/sfxbasemodel.cxx:716:13
> #57 in SdXImpressDocument::dispose() at sd/source/ui/unoidl/unomodel.cxx:2708:19
> #58 in LOKitSearchTest::tearDown() at sd/qa/unit/tiledrendering/LOKitSearchTest.cxx:113:22
[...]
where the given rRange is apparently empty
Change-Id: I7324f1660dc3b782a4e489884a319f4aeb690b44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102492
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sdr/overlay/overlaymanager.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 6f4068227acb..edeb8ec92b98 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -282,6 +282,9 @@ namespace sdr::overlay tools::Rectangle OverlayManager::RangeToInvalidateRectangle(const basegfx::B2DRange& rRange) const { + if (rRange.isEmpty()) { + return {}; + } if (getDrawinglayerOpt().IsAntiAliasing()) { // assume AA needs one pixel more and invalidate one pixel more |