diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index bbd59c055d34..fe9475d36170 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1078,6 +1078,9 @@ sal_uInt64 PictReader::ReadPixMapEtc( BitmapEx &rBitmap, bool bBaseAddr, bool bC pBitmap.reset(new vcl::bitmap::RawBitmap( Size(nWidth, nHeight), 24 )); + // cid#1458434 to sanitize Untrusted loop bound + nWidth = pBitmap->Width(); + size_t nByteWidth = static_cast(nWidth) * nCmpCount; std::vector aScanline(nByteWidth); for (sal_uInt16 ny = 0; ny < nHeight; ++ny)