summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-02 20:05:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-04 08:17:06 +0200
commitd4dc6b5cfdb02ad00a06ad32650948648abe010d (patch)
tree02446cd93e68aba9b78db6eb7fc902e782c6faf9 /filter
parent86fa9c907387e96c9c93f1e17239730271fedbfd (diff)
use std::vector for fetching DX array data
because I'm trying to track down a related heap corruption, and that is much easier if the access to the array is checked by the std::vector debug runtime Change-Id: Ia665f5cebb7f14d88942e88b4b400ad3c28ef5d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgwriter.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 082d7d8b0377..34b4f1a255a5 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -2644,18 +2644,18 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText,
ImplMap( rPos, aPos );
- std::unique_ptr<tools::Long[]> xTmpArray(new tools::Long[nLen]);
+ std::vector<tools::Long> aTmpArray(nLen);
// get text sizes
if( pDXArray )
{
aNormSize = Size( mpVDev->GetTextWidth( rText ), 0 );
- memcpy(xTmpArray.get(), pDXArray, nLen * sizeof(tools::Long));
+ memcpy(aTmpArray.data(), pDXArray, nLen * sizeof(tools::Long));
}
else
{
- aNormSize = Size( mpVDev->GetTextArray( rText, xTmpArray.get() ), 0 );
+ aNormSize = Size( mpVDev->GetTextArray( rText, &aTmpArray ), 0 );
}
- tools::Long* pDX = xTmpArray.get();
+ tools::Long* pDX = aTmpArray.data();
// if text is rotated, set transform matrix at new g element
if( rFont.GetOrientation() )