[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 31 12:45:24 UTC 2021


 vcl/source/filter/graphicfilter.cxx  |    2 +-
 vcl/source/filter/graphicfilter2.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e822d5590e48a1100717b5d0ae2b6d72f4f936da
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 30 15:59:44 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 31 14:44:50 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: Iaeae1efd2da2add9729bab38137c8ff1fb9818db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121362
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index d7848b83a8bb..3ff7de43e2fb 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -924,7 +924,7 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
                 if (nStatus == ERRCODE_NONE)
                 {
                     rIStream.Seek(nStreamBegin);
-                    rIStream.ReadBytes(pGraphicContent.get(), nGraphicContentSize);
+                    nGraphicContentSize = rIStream.ReadBytes(pGraphicContent.get(), nGraphicContentSize);
                 }
             }
         }
diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx
index 5666497ce08f..0360c51d3347 100644
--- a/vcl/source/filter/graphicfilter2.cxx
+++ b/vcl/source/filter/graphicfilter2.cxx
@@ -593,7 +593,7 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo )
                     // read up to the start of the image
                     rStm.ReadUInt32( nLen32 );
                     rStm.ReadUInt32( nTemp32 );
-                    while( ( nTemp32 != 0x49444154 ) && rStm.good() )
+                    while (rStm.good() && nTemp32 != 0x49444154)
                     {
                         if ( nTemp32 == 0x70485973 ) // physical pixel dimensions
                         {


More information about the Libreoffice-commits mailing list