filter/source/graphicfilter/itiff/itiff.cxx |   11 ++++++-----
 svl/source/numbers/zforfind.cxx             |   21 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit fa0ad0e5ce5ea837c55adf64bd2e85587b099b55
Author:     Eike Rathke <[email protected]>
AuthorDate: Fri Jul 12 11:16:07 2019 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Aug 5 09:55:00 2019 +0200

    Resolves: tdf#126342 obtain date particle order from pattern match
    
    ... if there was any. In the NF_EVALDATEFORMAT_FORMAT_INTL case
    the input may match a current locale's pattern instead of a
    format's locale's pattern and patterns' (format locale + current
    locale) date orders may be different from the format's date order.
    
    Change-Id: I3aeaa6c361f98fe80f69c4f5d975fca892dac6ea
    Reviewed-on: https://gerrit.libreoffice.org/75481
    Reviewed-by: Eike Rathke <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 7de96e9f7b69354fd5b15e1276678000bc386568)
    Reviewed-on: https://gerrit.libreoffice.org/75491
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 7af89de46ff4a40a8161fd629584d54cfdeadee1)
    Reviewed-on: https://gerrit.libreoffice.org/76934
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 0ec1cd812418..dfb66e3de235 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1699,7 +1699,26 @@ bool ImpSvNumberInputScan::GetDateRef( double& fDays, 
sal_uInt16& nCounter )
             else
             {
                 bFormatTurn = true;
-                DateFmt = mpFormat->GetDateOrder();
+                // Even if the format pattern is to be preferred, the input may
+                // have matched a pattern of the current locale, which then
+                // again is to be preferred. Both date orders can be different
+                // so we need to obtain the actual match. For example ISO
+                // YYYY-MM-DD format vs locale's DD.MM.YY input.
+                if (!GetDatePatternOrder())
+                {
+                    // No pattern match => format match.
+                    DateFmt = mpFormat->GetDateOrder();
+                }
+                else
+                {
+                    // Pattern match. Note that patterns may have been
+                    // constructed from the format's locale and prepended to
+                    // the current locale's patterns, it doesn't necessarily
+                    // mean a current locale's pattern was matched, but may if
+                    // the format's locale's patterns didn't match, which were
+                    // tried first.
+                    DateFmt = GetDateOrder();
+                }
             }
             break;
         default:
commit 986437766b35e800fb9b0cacac6e2555b8f02bc0
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Jul 17 16:13:17 2019 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Aug 5 09:54:47 2019 +0200

    Resolves: tdf#126147 relax sanity check and allow truncated tiffs
    
    now the start of the row of data must still exist, but the full
    length of the row doesn't have to exist
    
    Change-Id: I5ed8ffef2cab19f040ba789a5d82560ca6847f26
    Reviewed-on: https://gerrit.libreoffice.org/75795
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 38bf835b48efa2e32d917538cabc4fa2e1dec56d)
    Reviewed-on: https://gerrit.libreoffice.org/76933
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx 
b/filter/source/graphicfilter/itiff/itiff.cxx
index d2bb00e3720f..9c2236689fac 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -568,9 +568,11 @@ bool TIFFReader::ReadMap()
                 if ( nStrip >= aStripOffsets.size())
                     return false;
                 pTIFF->Seek( aStripOffsets[ nStrip ] + ( ny % 
GetRowsPerStrip() ) * nStripBytesPerRow );
-                pTIFF->ReadBytes(getMapData(np), nBytesPerRow);
-                if (!pTIFF->good())
-                    return false;
+                // tdf#126147 allow a short incomplete read
+                auto pDest = getMapData(np);
+                auto nRead = pTIFF->ReadBytes(pDest, nBytesPerRow);
+                if (nRead != nBytesPerRow)
+                    memset(pDest + nRead, 0, nBytesPerRow - nRead);
             }
             if ( !ConvertScanline( ny ) )
                 return false;
@@ -1510,8 +1512,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & 
rGraphic )
                     if (bStatus)
                     {
                         auto nStart = aStripOffsets[ nStrip ] + ( ny % 
GetRowsPerStrip() ) * nStripBytesPerRow;
-                        auto nEnd = nStart + nBytesPerRow;
-                        if (nEnd > nEndOfFile)
+                        if (nStart > nEndOfFile)
                             bStatus = false;
                     }
                 }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to