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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun Oct 3 13:36:20 UTC 2021


 emfio/source/reader/emfreader.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit e69d4963c3a7b71b4dc42e2f30b5cbdc4155d594
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 2 20:34:56 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 3 15:35:46 2021 +0200

    ofz#39528 Integer-overflow
    
    Change-Id: If50af8538e31e4fb1ee1486ec2b91963c094e7e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123007
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index b75d16c5759f..af79b261d1e7 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1967,26 +1967,26 @@ namespace emfio
                                             }
                                         }
 
-                                        sal_Int32 nDx = 0, nDy = 0;
+                                        pDXAry[i] = 0;
+                                        if (nOptions & ETO_PDY)
+                                        {
+                                            pDYAry[i] = 0;
+                                        }
+
                                         while (nDxCount--)
                                         {
                                             sal_Int32 nDxTmp = 0;
                                             mpInputStream->ReadInt32(nDxTmp);
-                                            nDx += nDxTmp;
+                                            pDXAry[i] += nDxTmp;
                                             if (nOptions & ETO_PDY)
                                             {
                                                 sal_Int32 nDyTmp = 0;
                                                 mpInputStream->ReadInt32(nDyTmp);
-                                                nDy += nDyTmp;
+                                                pDYAry[i] += nDyTmp;
                                             }
                                         }
 
-                                        SAL_INFO("emfio", "\t\t\tSpacing " << i << ": " << nDx);
-                                        pDXAry[i] = nDx;
-                                        if (nOptions & ETO_PDY)
-                                        {
-                                            pDYAry[i] = nDy;
-                                        }
+                                        SAL_INFO("emfio", "\t\t\tSpacing " << i << ": " << pDXAry[i]);
                                     }
                                 }
                                 if ( nOptions & ETO_CLIPPED )


More information about the Libreoffice-commits mailing list