diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-28 10:18:57 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-09-07 11:17:56 +0200 |
commit | 674b916128b68297787be9cb86faec925d5f2c68 (patch) | |
tree | fd62a94bb576089136426eb132ec4bb3c487df85 /filter | |
parent | ce37abecaabae3c2dc37335bbd01b58b58e3fea9 (diff) |
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: Id3acc87a697a61bcf3794745846071bc99fc8d8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121190
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/ipsd/ipsd.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 90b7746029b8..6e9ba1aa8438 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -611,7 +611,7 @@ bool PSDReader::ImplReadBody() if (mpFileHeader->nMode == PSD_CMYK && m_rPSD.good()) { sal_uInt32 nBlack, nBlackMax = 0; - std::unique_ptr<sal_uInt8[]> pBlack(new sal_uInt8[ mpFileHeader->nRows * mpFileHeader->nColumns ]); + std::vector<sal_uInt8> aBlack(mpFileHeader->nRows * mpFileHeader->nColumns, 0); nY = 0; while (nY < mpFileHeader->nRows && m_rPSD.good()) { @@ -640,7 +640,7 @@ bool PSDReader::ImplReadBody() nBlack = mpBitmap->GetPixel( nY, nX ).GetBlue() + nDat; if ( nBlack > nBlackMax ) nBlackMax = nBlack; - pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff; + aBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff; if ( ++nX == mpFileHeader->nColumns ) { nX = 0; @@ -667,7 +667,7 @@ bool PSDReader::ImplReadBody() nBlack = mpBitmap->GetPixel( nY, nX ).GetBlue() + nDat; if ( nBlack > nBlackMax ) nBlackMax = nBlack; - pBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff; + aBlack[ nX + nY * mpFileHeader->nColumns ] = nDat ^ 0xff; if ( ++nX == mpFileHeader->nColumns ) { nX = 0; @@ -683,7 +683,7 @@ bool PSDReader::ImplReadBody() { for ( nX = 0; nX < mpFileHeader->nColumns; nX++ ) { - sal_Int32 nDAT = pBlack[ nX + nY * mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff; + sal_Int32 nDAT = aBlack[ nX + nY * mpFileHeader->nColumns ] * ( nBlackMax - 256 ) / 0x1ff; aBitmapColor = mpBitmap->GetPixel( nY, nX ); sal_uInt8 cR = static_cast<sal_uInt8>(MinMax( aBitmapColor.GetRed() - nDAT, 0, 255L )); |