vcl/source/filter/itiff/itiff.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0dce241698ff906c10f8a95da43009b6feeb7bd3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Mar 1 17:39:17 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Mar 2 09:40:11 2022 +0100

    ofz#45063 Out-of-memory
    
    Change-Id: I3d7635b80fc3c64951bd01eed22a019328ce7183
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130814
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index ae797aa978a5..11af8b4482ef 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -399,7 +399,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, 
sal_uInt32 nDataLen)
         case 0x0111: { // Strip Offset(s)
             size_t nOldNumSO = aStripOffsets.size();
             nDataLen += nOldNumSO;
-            size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / 
sizeof(sal_uInt32);
+            size_t const nMaxAllocAllowed = SAL_MAX_INT32 / sizeof(sal_uInt32);
             size_t nMaxRecordsAvailable = pTIFF->remainingSize() / 
DataTypeSize();
             if (nDataLen > nOldNumSO && nDataLen < nMaxAllocAllowed &&
                 (nDataLen - nOldNumSO) <= nMaxRecordsAvailable)
@@ -445,7 +445,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, 
sal_uInt32 nDataLen)
         case 0x0117: { // Strip Byte Counts
             size_t nOldNumSBC = aStripByteCounts.size();
             nDataLen += nOldNumSBC;
-            size_t const nMaxAllocAllowed = SAL_MAX_UINT32 / 
sizeof(sal_uInt32);
+            size_t const nMaxAllocAllowed = SAL_MAX_INT32 / sizeof(sal_uInt32);
             size_t nMaxRecordsAvailable = pTIFF->remainingSize() / 
DataTypeSize();
             if (nDataLen > nOldNumSBC && nDataLen < nMaxAllocAllowed &&
                 (nDataLen - nOldNumSBC) <= nMaxRecordsAvailable)

Reply via email to