xmloff/source/text/XMLTextFrameContext.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 6669c1a06bcc3ce31c9c17c714fdf2c2e0e25360
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Aug 30 09:22:47 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Aug 30 12:12:00 2021 +0200

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

diff --git a/xmloff/source/text/XMLTextFrameContext.cxx 
b/xmloff/source/text/XMLTextFrameContext.cxx
index fbe537dd424b..0ab223b3c109 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -891,8 +891,8 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
             if( aIter.toView().find( '%' ) != std::string_view::npos )
             {
                 sal_Int32 nTmp;
-                ::sax::Converter::convertPercent( nTmp, aIter.toView() );
-                nRelWidth = static_cast<sal_Int16>(nTmp);
+                if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
+                    nRelWidth = static_cast<sal_Int16>(nTmp);
             }
             else
             {
@@ -917,8 +917,8 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
             if( aIter.toView().find( '%' ) != std::string_view::npos )
             {
                 sal_Int32 nTmp;
-                ::sax::Converter::convertPercent( nTmp, aIter.toView() );
-                nRelWidth = static_cast<sal_Int16>(nTmp);
+                if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
+                    nRelWidth = static_cast<sal_Int16>(nTmp);
             }
             else
             {
@@ -933,8 +933,8 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
             if( aIter.toView().find( '%' ) != std::string_view::npos )
             {
                 sal_Int32 nTmp;
-                ::sax::Converter::convertPercent( nTmp, aIter.toView() );
-                nRelHeight = static_cast<sal_Int16>(nTmp);
+                if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
+                    nRelHeight = static_cast<sal_Int16>(nTmp);
             }
             else
             {
@@ -964,8 +964,8 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
             if( aIter.toView().find( '%' ) != std::string_view::npos )
             {
                 sal_Int32 nTmp;
-                ::sax::Converter::convertPercent( nTmp, aIter.toView() );
-                nRelHeight = static_cast<sal_Int16>(nTmp);
+                if (::sax::Converter::convertPercent(nTmp, aIter.toView()))
+                    nRelHeight = static_cast<sal_Int16>(nTmp);
             }
             else
             {

Reply via email to