[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 25 13:00:10 UTC 2021
vcl/source/filter/ieps/ieps.cxx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 8f7b8a6c068c6484b05edb2aac643142df6d44ac
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 23 20:08:48 2021 +0100
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Aug 25 14:59:35 2021 +0200
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: I364368cf4f5cb68c03bbff81f42002f56e3e44af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120923
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 4556dd0f9d154c9b71b009f6dcf9f3e54d9a4d85)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120976
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/vcl/source/filter/ieps/ieps.cxx b/vcl/source/filter/ieps/ieps.cxx
index 946fbf30b3d7..7b5a0c96dd10 100644
--- a/vcl/source/filter/ieps/ieps.cxx
+++ b/vcl/source/filter/ieps/ieps.cxx
@@ -635,11 +635,12 @@ bool ImportEpsGraphic( SvStream & rStream, Graphic & rGraphic)
nPSSize = rStream.Seek( STREAM_SEEK_TO_END ) - nOrigPos;
}
- std::unique_ptr<sal_uInt8[]> pHeader( new sal_uInt8[ 22 ] );
+ std::vector<sal_uInt8> aHeader(22, 0);
rStream.Seek( nPSStreamPos );
- rStream.ReadBytes(pHeader.get(), 22); // check PostScript header
- bool bOk = ImplSearchEntry(pHeader.get(), reinterpret_cast<sal_uInt8 const *>("%!PS-Adobe"), 10, 10) &&
- ImplSearchEntry(&pHeader[ 15 ], reinterpret_cast<sal_uInt8 const *>("EPS"), 3, 3);
+ rStream.ReadBytes(aHeader.data(), 22); // check PostScript header
+ sal_uInt8* pHeader = aHeader.data();
+ bool bOk = ImplSearchEntry(pHeader, reinterpret_cast<sal_uInt8 const *>("%!PS-Adobe"), 10, 10) &&
+ ImplSearchEntry(pHeader + 15, reinterpret_cast<sal_uInt8 const *>("EPS"), 3, 3);
if (bOk)
{
rStream.Seek(nPSStreamPos);
More information about the Libreoffice-commits
mailing list