diff options
-rw-r--r-- | filter/source/graphicfilter/ipict/ipict.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 9d9499652b34..3fc16ef9e97c 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1080,13 +1080,13 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo sal_uInt8 nFlagCounterByte; if ( ( nCmpCount == 3 ) || ( nCmpCount == 4 ) ) { - if ( ( pAcc = initBitmap(aBitmap, aPalette) ) == nullptr ) - return 0xffffffff; - size_t nByteCountSize = nRowBytes > 250 ? sizeof(sal_uInt16) : sizeof(sal_uInt8); if (nHeight > pPict->remainingSize() / nByteCountSize) return 0xffffffff; + if ( ( pAcc = initBitmap(aBitmap, aPalette) ) == nullptr ) + return 0xffffffff; + std::unique_ptr<sal_uInt8[]> pScanline(new sal_uInt8[static_cast<size_t>(nWidth) * nCmpCount]); for (sal_uInt16 ny = 0; ny < nHeight; ++ny) { |