[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Mon Feb 6 09:29:49 UTC 2017
filter/source/graphicfilter/ipict/ipict.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit bac4b46e86f13fdbfc53a932bc61ac92a0f44f1d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 6 09:27:15 2017 +0000
Resolves: ofz#547 Floating-point-exception
Change-Id: I9612bef0198ce8f09d39f5000a31819c175027d1
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 98aaf6f..8e6a4ea 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -930,7 +930,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
if (nRowBytes < 8 || nPackType == 1)
{
- if (nHeight > pPict->remainingSize() / (sizeof(sal_uInt16) * nWidth))
+ if (nWidth && nHeight > pPict->remainingSize() / (sizeof(sal_uInt16) * nWidth))
return 0xffffffff;
}
else
@@ -1030,10 +1030,10 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
if ( nRowBytes < 8 || nPackType == 1 )
{
const size_t nMaxPixels = pPict->remainingSize() / 4;
- const size_t nMaxRows = nMaxPixels / nWidth;
+ const size_t nMaxRows = nWidth ? nMaxPixels / nWidth : SAL_MAX_UINT16;
if (nHeight > nMaxRows)
return 0xffffffff;
- const size_t nMaxCols = nMaxPixels / nHeight;
+ const size_t nMaxCols = nHeight ? nMaxPixels / nHeight : SAL_MAX_UINT16;
if (nWidth > nMaxCols)
return 0xffffffff;
@@ -1053,10 +1053,10 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
else if ( nPackType == 2 )
{
const size_t nMaxPixels = pPict->remainingSize() / 3;
- const size_t nMaxRows = nMaxPixels / nWidth;
+ const size_t nMaxRows = nWidth ? nMaxPixels / nWidth : SAL_MAX_UINT16;
if (nHeight > nMaxRows)
return 0xffffffff;
- const size_t nMaxCols = nMaxPixels / nHeight;
+ const size_t nMaxCols = nMaxPixels ? nMaxPixels / nHeight : SAL_MAX_UINT16;
if (nWidth > nMaxCols)
return 0xffffffff;
More information about the Libreoffice-commits
mailing list