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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 16 14:37:16 UTC 2021


 oox/source/export/vmlexport.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 96d839a991d7d271adce37a41bccf54b015c9c35
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Feb 16 14:08:14 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Feb 16 15:36:24 2021 +0100

    Fix index out of range when vml-shape-types is missing
    
    See https://lists.freedesktop.org/archives/libreoffice/2021-February/086844.html
    
    Change-Id: Id38061c03dc80700872b41f54c679ee3120df9f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110988
    Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a9e5dcf6d20c..07157edc3f85 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1310,13 +1310,13 @@ sal_Int32 VMLExport::StartShape()
 
                 // a predefined shape?
                 static std::vector<OString> aShapeTypes = lcl_getShapeTypes();
-                OString aShapeType = aShapeTypes[ m_nShapeType ];
-                if ( aShapeType != "NULL" )
+                SAL_WARN_IF(m_nShapeType >= aShapeTypes.size(), "oox.vml", "Unknown shape type!");
+                if (m_nShapeType < aShapeTypes.size() && aShapeTypes[m_nShapeType] != "NULL")
                 {
                     bReferToShapeType = true;
                     if ( !m_aShapeTypeWritten[ m_nShapeType ] )
                     {
-                        m_pSerializer->write( aShapeType.getStr() );
+                        m_pSerializer->write(aShapeTypes[m_nShapeType]);
                         m_aShapeTypeWritten[ m_nShapeType ] = true;
                     }
                 }


More information about the Libreoffice-commits mailing list