diff options
author | Henry Castro <hcastro@collabora.com> | 2022-02-10 10:25:52 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:00:12 +0100 |
commit | f5c0655ebac03c2de759142254ced4cc37d664b1 (patch) | |
tree | be2f2ae11ab21c2d980ec49b1545d1ea3a5e40fe /svx | |
parent | a0861d12e70a56a14761c23af7a80ce757d1ccb2 (diff) |
svx: fix dynamic cast SdrView
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/collabora/online-buildscripts/staging/builddir/libreoffice/svx/source/sdr/contact/objectcontactofpageview.cxx:353:57 in
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: /home/collabora/online-buildscripts/staging/builddir/libreoffice/include/svx/svdview.hxx:235:65: runtime error: member access within address 0x61c000489880 which does not point to an object of type 'SdrView'
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: 0x61c000489880: note: object is of type 'SdrPaintView'
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: 7c 04 80 3b 90 58 b9 3d 60 7f 00 00 30 51 96 0a 20 60 00 00 38 51 96 0a 20 60 00 00 38 51 96 0a
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: ^~~~~~~~~~~~~~~~~~~~~~~
Jan 19 13:48:41 ip-172-31-35-149 coolwsd[23647]: vptr for 'SdrPaintView'
Change-Id: Ifc9177902ac834d400d6bf9f72b94e82f544b348
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129791
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdpntv.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index addf221c9bb1..a069edfe3362 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -363,8 +363,11 @@ SdrPageView* SdrPaintView::ShowSdrPage(SdrPage* pPage) mpPageView.reset(); } - mpPageView.reset(new SdrPageView(pPage, *static_cast<SdrView*>(this))); - mpPageView->Show(); + if (SdrView *pView = dynamic_cast<SdrView*>(this)) + { + mpPageView.reset(new SdrPageView(pPage, *pView)); + mpPageView->Show(); + } } return mpPageView.get(); |